Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     KeysSet k = new KeysSet();
     Computer c = new Computer();
     string m1 = k.EncryptDES(c.CpuID,"zanglili");
     //string m2 = k.EncryptDES(textBox1.Text, "zanglili");
     string m2 = textBox1.Text;
     if (m1 == m2)
     {
         FileRead f = new FileRead();
         f.WriterData(m1);
         YZ.ActiveForm.Close();
     }
     else 
     {
         MessageBox.Show("认证错误,请咨询管理人员");
     }
 }
Exemplo n.º 2
0
        public void YZ()
        {
            Computer c = new Computer();
            KeysSet k = new KeysSet();
            FileRead f = new FileRead();
            string from_key = f.ReadData();
            string key = c.CpuID;

            if (k.EncryptDES(c.CpuID, "zanglili") != from_key)
            {
                MessageBox.Show("请验证");
                YZ y = new YZ();
                y.ShowDialog();
            }

            //String a1 = k.EncryptDES(key, "zanglili");
            //MessageBox.Show(a1);//加密后的字符串
            //String a2 = k.DecryptDES(a1, "zanglili");
            //MessageBox.Show(a2);//解密后的原样字符串
            // return i;
        }