private void button2_Click(object sender, EventArgs e) { textBox3.Text = MachineCode.GetMachineCodeString(); string b = ""; a.GetHash(textBox3.Text, ref b); string b2 = ""; a.SignatureFormatter(xmlKeys, b, ref b2); textBox4.Text = b2; }
private void button3_Click(object sender, EventArgs e) { textBox3.Text = MachineCode.GetMachineCodeString(); string b = ""; a.GetHash(textBox3.Text, ref b); bool bo = a.SignatureDeformatter(xmlPublicKey, b, textBox4.Text); if (bo) { MessageBox.Show("验证成功!"); } }
public static string GetMachineCodeString() { string machineCodeString = string.Empty; if (machineCode == null) { machineCode = new MachineCode(); } machineCodeString = "PC." + machineCode.GetCpuInfo() + "." + machineCode.GetHDid() + "." + machineCode.GetMoAddress(); machineCodeString = EncryptUtil.Md532(machineCodeString); return(machineCodeString); }