コード例 #1
0
        public static void RegisterID()
        {
            var content       = HardWareInfo.GetInfo(HardWareInfo.InfoType.CPUID);
            var encryptstring = DESEncrypt.Encrypt(content);

            Registry.SetValue(Registry.LocalMachine.Name + "\\SOFTWARE\\mySoftWare", "License", encryptstring);
        }
コード例 #2
0
        public static bool VerifyID()
        {
            var content = HardWareInfo.GetInfo(HardWareInfo.InfoType.CPUID);

            try
            {
                var license       = Registry.GetValue(Registry.LocalMachine.Name + "\\SOFTWARE\\mySoftWare", "License", null);
                var decryptstring = DESEncrypt.Decrypt(license.ToString());
                return(decryptstring == content);
            }
            catch (Exception)
            {
                return(false);
            }
        }