Ejemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("请先获取机器码");
            }

            string data = Module1.AesEncrypt(Encoding.Default.GetBytes(textBox1.Text), new byte[]
            {
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15,
                15
            });

            textBox2.Text = data;
        }
Ejemplo n.º 2
0
        private static string keyGen()
        {
            byte[] keyArray = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 };
            string s        = FormsAuthentication.HashPasswordForStoringInConfigFile(Module1.GETCPUID() + Module1.GetDiskSerialNumber() + Module1.GetMacAddress(), "SHA1");

            return(Module1.AesEncrypt(Encoding.Default.GetBytes(s), keyArray));
        }