اشتراک‌ها
Heartbleed و static analysis
?why is anyone still writing security-critical infrastructure in languages that lack memory safety at runtime
Heartbleed و static analysis
نظرات مطالب
سفارشی سازی ASP.NET Core Identity - قسمت اول - موجودیت‌های پایه و DbContext برنامه
- من از ویژوال استودیو استفاده نمی‌کنم (آخرین نگارشی از آن که روی سیستم من نصب است، نگارش 2015 است). تمام کار این برنامه با VSCode انجام شده و با آن مشکلی نیست. برای کنترل کیفیت برنامه و دسترسی به معادل ReSharper هم می‌توانید از Rider استفاده کنید.
- مطابق مستندات رسمی خود مایکروسافت، VS 2017 دیگر از SDKهای جدید پشتیبانی نمی‌کند و از این پس نیاز به نصب نگارش 2019 را خواهید داشت (این مورد اجباری است برای کسانیکه می‌خواهند از VS و NET Core. استفاده کنند):
.NET Core SDK .NET Core Runtime Compatible Visual Studio MSBuild Notes
2.1.5nn 2.1 2017 15 Installed as part of VS 2017 version 15.9
2.1.6nn 2.1 2019 16 Installed as part of VS 2019
2.2.1nn 2.2 2017 15 Installed manually
2.2.2nn 2.2 2019 16 Installed as part of VS 2019
3.0.1nn 3.0 (Preview) 2019 16 Installed manually

Visual Studio 2017 cannot work with .NET Core SDK 2.1.6nn or 2.2.2nn. 

نظرات مطالب
نحوه‌ی استخراج شماره سریال سخت افزار برای تولید یک قفل سخت افزاری
می توان از این کلاس هم که در واقع بسط داده شده‌ی روش مذکور است استفاده نمود:
    public class FingerPrint
    {
        private static string fingerPrint = string.Empty;
        public static string Value()
        {
            if (string.IsNullOrEmpty(fingerPrint))
            {
                fingerPrint = GetHash("CPU >> " + cpuId() + "\nBIOS >> " +
            biosId() + "\nBASE >> " + baseId()
                    +"\nDISK >> "+ diskId() + "\nVIDEO >> " + 
                    videoId() +"\nMAC >> "+ macId());
            }
            return fingerPrint;
        }
        private static string GetHash(string s)
        {
            MD5 sec = new MD5CryptoServiceProvider();
            ASCIIEncoding enc = new ASCIIEncoding();
            byte[] bt = enc.GetBytes(s);
            return GetHexString(sec.ComputeHash(bt));
        }
        private static string GetHexString(byte[] bt)
        {
            string s = string.Empty;
            for (int i = 0; i < bt.Length; i++)
            {
                byte b = bt[i];
                int n, n1, n2;
                n = (int)b;
                n1 = n & 15;
                n2 = (n >> 4) & 15;
                if (n2 > 9)
                    s += ((char)(n2 - 10 + (int)'A')).ToString();
                else
                    s += n2.ToString();
                if (n1 > 9)
                    s += ((char)(n1 - 10 + (int)'A')).ToString();
                else
                    s += n1.ToString();
                if ((i + 1) != bt.Length && (i + 1) % 2 == 0) s += "-";
            }
            return s;
        }


        #region Original Device ID Getting Code
        //Return a hardware identifier
        private static string identifier
        (string wmiClass, string wmiProperty, string wmiMustBeTrue)
        {
            string result = "";
            System.Management.ManagementClass mc =
        new System.Management.ManagementClass(wmiClass);
            System.Management.ManagementObjectCollection moc = mc.GetInstances();
            foreach (System.Management.ManagementObject mo in moc)
            {
                if (mo[wmiMustBeTrue].ToString() == "True")
                {
                    //Only get the first one
                    if (result == "")
                    {
                        try
                        {
                            result = mo[wmiProperty].ToString();
                            break;
                        }
                        catch
                        {
                        }
                    }
                }
            }
            return result;
        }
        //Return a hardware identifier
        private static string identifier(string wmiClass, string wmiProperty)
        {
            string result = "";
            System.Management.ManagementClass mc =
        new System.Management.ManagementClass(wmiClass);
            System.Management.ManagementObjectCollection moc = mc.GetInstances();
            foreach (System.Management.ManagementObject mo in moc)
            {
                //Only get the first one
                if (result == "")
                {
                    try
                    {
                        result = mo[wmiProperty].ToString();
                        break;
                    }
                    catch
                    {
                    }
                }
            }
            return result;
        }
        private static string cpuId()
        {
            //Uses first CPU identifier available in order of preference
            //Don't get all identifiers, as it is very time consuming
            string retVal = identifier("Win32_Processor", "UniqueId");
            if (retVal == "") //If no UniqueID, use ProcessorID
            {
                retVal = identifier("Win32_Processor", "ProcessorId");
                if (retVal == "") //If no ProcessorId, use Name
                {
                    retVal = identifier("Win32_Processor", "Name");
                    if (retVal == "") //If no Name, use Manufacturer
                    {
                        retVal = identifier("Win32_Processor", "Manufacturer");
                    }
                    //Add clock speed for extra security
                    retVal += identifier("Win32_Processor", "MaxClockSpeed");
                }
            }
            return retVal;
        }
        //BIOS Identifier
        private static string biosId()
        {
            return identifier("Win32_BIOS", "Manufacturer")
                + identifier("Win32_BIOS", "SMBIOSBIOSVersion")
            + identifier("Win32_BIOS", "IdentificationCode")
                + identifier("Win32_BIOS", "SerialNumber")
                + identifier("Win32_BIOS", "ReleaseDate")
                + identifier("Win32_BIOS", "Version");
        }
        //Main physical hard drive ID
        private static string diskId()
        {
            return identifier("Win32_DiskDrive", "Model")
            + identifier("Win32_DiskDrive", "Manufacturer")
            + identifier("Win32_DiskDrive", "Signature")
            + identifier("Win32_DiskDrive", "TotalHeads");
        }
        //Motherboard ID
        private static string baseId()
        {
            return identifier("Win32_BaseBoard", "Model")
            + identifier("Win32_BaseBoard", "Manufacturer")
            + identifier("Win32_BaseBoard", "Name")
            + identifier("Win32_BaseBoard", "SerialNumber");
        }
        //Primary video controller ID
        private static string videoId()
        {
            return identifier("Win32_VideoController", "DriverVersion")
            + identifier("Win32_VideoController", "Name");
        }
        //First enabled network card ID
        private static string macId()
        {
            return identifier("Win32_NetworkAdapterConfiguration",
                "MACAddress", "IPEnabled");
        }
        #endregion
    }
خروجی این کلاس Hexal است و به شکل زیر قابل استفاده می‌باشد:
/// Generates a 16 byte Unique Identification code of a computer 
/// Example: 4876-8DB5-EE85-69D3-FE52-8CF7-395D-2EA9

var computerId = FingerPrint.Value();

اشتراک‌ها
اولین ویدیو از سری ویدیو های بررسی معماری نرم افزار

تو این ویدیو اول سراغ تاریخچه معماری رفتیم و بعد به این رسیدیم که چرا توی یه جنگلی از اسامی معمارگونه گیر کرده ایم و سعی داریم از این همه اسامی و الگو‌ها و معماری‌های مختلف رو طبقه بندی کنیم.


02:30 History of the Software Architecture
16:00 Architecture vs Design
19:00 Software Architecture vs Software Design 

اولین ویدیو از سری ویدیو های بررسی معماری نرم افزار
اشتراک‌ها
architectural styles چه چیز هایی هستند ؟
تو این ویدیو نگاهی انداختیم به این که اساسا به چه کسی میگیم معمار نرم افزار، و معماری یعنی چی، و اینکه یک بعد از 4 بعد معماری رو باهم بررسی کردیم بعد استراکچر یا استایل معماری.

 03:40 who is a software architecture 
06:30 What is Architecture 
10:00 Architectural Style 
16:15 Monolithic and Distributed architectural styles
architectural styles چه چیز هایی هستند ؟
اشتراک‌ها
ساخت لینک به بخش های مشخصی از ویدیوهای یوتیوب توسط C# 11

انجام کاری شبیه زیر برای ویدیوهای منتشرشده شما در youtube توسط یک اسکریپت C#

 
00:00:00 Introduction
00:01:30 Luce Carter
00:02:55 Luce’s History with Databases
00:08:10 Tables vs. Documents
00:16:48 Term Mapping Summary
ساخت لینک به بخش های مشخصی از ویدیوهای یوتیوب توسط C# 11