public static bool CheckSystemCode()
        {
            string systemCode = CommonConfigurationManager.GetAppConfig("SystemCode");

            if (systemCode.Trim() == "")
            {
                return(false);
            }
            try
            {
                return(AES.AESDecrypt(systemCode).Equals(SystemInformationCode.GetCpuID() + "zhangdahang"));
            }
            catch (Exception ex)
            {
            }
            return(false);
        }
 private void bt_OK_Click(object sender, EventArgs e)
 {
     try
     {
         //string mechineCode = "BFEBFBFF000806EA";
         string mechineCode = SystemInformationCode.GetCpuID();
         if (AES.AESDecrypt(textBox2.Text).Equals(mechineCode + "zhangdahang"))
         {
             CommonConfigurationManager.UpdateAppConfig("SystemCode", textBox2.Text);
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             MessageBox.Show("您输入的注册码不正确,请重新输入!");
         }
     }
     catch
     {
         MessageBox.Show("您输入的注册码不正确,请重新输入!");
     }
 }
 private void SystemCodeForm_Load(object sender, EventArgs e)
 {
     textBox1.Text = SystemInformationCode.GetCpuID();
 }