Exemplo n.º 1
0
 public YZ()
 {
     InitializeComponent();
     Computer c = new Computer();
     textBox2.Text = c.CpuID;
      
     
 }
Exemplo n.º 2
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.º 3
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;
        }
Exemplo n.º 4
0
 public static Computer Instance()
 {
     if (_instance == null)
         _instance = new Computer();
     return _instance;
 }