Software license key and activation

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/

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

}

  

时间: 2024-10-13 03:13:06

Software license key and activation的相关文章

View Composer Agent initialization error (16): Failed to activate software license (1026556)

1.       桌面发布过程中偶尔有些桌面池中的桌面提示无法访问代理,查看报错信息如下:View Composer Agent initialization error (16):Failed to activate software license (1026556). KB地址:https://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1026556 主要意思是Windows 7系统激活的

phpstorm 8 license key

phpstorm 8 license key Learn Programming===== LICENSE BEGIN =====63758-1204201000000Ryqh0NCC73lpRm!XVcxFChJ2gTUR2lZtlLXrPLbQ66Gs8MHs51RvF2yagoDlzne08Zm8VXbts1UMKE!EW4v8G===== LICENSE END =====

webstorm license key

JetBrains WebStorm注册码 UserName: William License Key : ===== LICENSE BEGIN ===== 45550-12042010 00001SzFN0n1bPII7FnAxnt0DDOPJA INauvJkeVJBuE5bqLEznccE4tet6tr RiyoMxDK8oDY93tx!ipPyGmqYYeWxS ===== LICENSE END =====

phpstorm8 license key

phpstorm8破解及license key Learn Programming ===== LICENSE BEGIN ===== 63758-12042010 00000Ryqh0NCC73lpRm!XVcxFChJ2g TUR2lZtlLXrPLbQ66Gs8MHs51RvF2y agoDlzne08Zm8VXbts1UMKE!EW4v8G ===== LICENSE END =====

Mac charles license key 注册码

之前新一在win平台上面经常使用fiddler来抓包:Mac下各同学都推荐使用哦charles来抓包:今天刚好有抓包的需求为此下载charles体验一番:Mac charles license key 适合3.9.3/3.9.2 注册码 Registered Name: http://ninjasaga.cheat.centerLicence Key: 18e69f6d5bc820d4d3Versi: 3.9.3/3.9.2 顺带附送老的Mac charles license key 也能回光返

java IntelliJ IDEA 13 注册码 IDEA序列号 License Key

java IntelliJ IDEA 13 注册码 IDEA序列号 License Key Username: [email protected] License: 282971-M1NWC-FP97E-MHFRO-UZQRY-F2WR0 java IntelliJ IDEA 13 注册码 IDEA序列号 License Key

Sublime Text 注册码 License Key

Sublime Text (3103版本可用) 注册码 License Key

Sublime Text Build 3065 License key

Sublime Text Build 3065 License key 复制如下三个任意一个正版注册码即可 —– BEGIN LICENSE —– Andrew Weber Single User License EA7E-855605 813A03DD 5E4AD9E6 6C0EEB94 BC99798F 942194A6 02396E98 E62C9979 4BB979FE 91424C9D A45400BF F6747D88 2FB88078 90F5CC94 1CDC92DC 84571

How to get a TexturePacker license Key 怎样获得免费的 TexturePacker license Key

TexturePacker是一款功能很强大的图片制作工具.只是使用一段时间之后就要license Key了.可是 TexturePacker的作者Andreas L?w先生已经给出获得免费key 的方法...大家能够到这个站点去申请 http://www.codeandweb.com/request-free-license  在此感谢 Andreas L?w 先生的无私奉献..