Software license key and activation, licenseactivation

Source: Internet
Author: User

Software license key and activation, licenseactivation

Http://stackoverflow.com/questions/16222674/software-license-key-and-activation
Https://github.com/Labs64
Http://www.codeproject.com/Articles/11012/License-Key-Generation
Https://ellipter.com/
Https://technet.microsoft.com/en-us/library/dd346641 (v = ws.10). aspx
Https://code.msdn.microsoft.com/windowsapps/Product-Key-Activation-to-16c92174/view/SourceCode
Https://activatar.codeplex.com/
Http://dotlicense.codeplex.com/
Http://www.codeproject.com/Articles/15496/Application-Trial-Maker
Http://www.c-sharpcorner.com/article/a-simple-approach-to-product-activation/
Http://www.codeproject.com/Articles/35009/How-to-Generate-and-Validate-CD-Keys-for-your-Soft
Https://licensekeygenerator.codeplex.com/

Http://softwareprotector.codeplex.com/

Http://skgl.codeplex.com/

Http://dotlicense.codeplex.com/

 

public static class Activation{    #region  Redegit Key    public static  void MakeRegeditActivationCode()    {        Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Activation");    }    public static string ReadRegeditKey()    {        try        {            RegistryKey myKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Activation", true);            return myKey.GetValue("ActivationCode").ToString();        }        catch        {            SetRegeditKeyValue("");            return null;        }    }    public static void SetRegeditKeyValue(string value)    {        RegistryKey myKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Activation", true);        myKey.SetValue("ActivationCode", value, RegistryValueKind.String);    }    #endregion    #region Get Hardware Information    public static string GetMacAddress()    {        string macAddresses = "";        foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())        {            macAddresses = nic.GetPhysicalAddress().ToString();            break;        }        return macAddresses;    }    public static string GetCpuId()    {        string cpuid = null;        try        {            ManagementObjectSearcher mo = new ManagementObjectSearcher("select * from Win32_Processor");            foreach (var item in mo.Get())            {                cpuid = item["ProcessorId"].ToString();            }            return cpuid;        }        catch        {            return null;        }    }    #endregion    #region Hash Function    public static string MyCustomHash(string input)    {        System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();        byte[] bs = System.Text.Encoding.UTF32.GetBytes(input);        bs = x.ComputeHash(bs);        System.Text.StringBuilder s = new System.Text.StringBuilder();        int select = 1;        foreach (byte b in bs)        {            switch (select)            {                case 1:                    s.Append(b.ToString("x4").ToLower());                    break;                case 2:                    s.Append(b.ToString("x3").ToLower());                    break;                case 3:                    s.Append(b.ToString("x2").ToLower());                    break;                case 4:                    s.Append(b.ToString("x1").ToLower());                    break;                default:                    break;            }            select++;            if (select > 4) select = 1;        }        string password = s.ToString();        return password;    }    #endregion}

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.