Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0 || textBox2.Text.Length == 0 || textBox4.Text.Length != 2)
            {
                MessageBox.Show("请输入正确用户名密码以及帐号后两位来注册");
                return;
            }
            string pass = HTTP.EncryptMD5(HTTP.EncryptMD5(textBox2.Text));

            try
            {
                string ret = HTTP.Login2(textBox1.Text, pass, 1, textBox4.Text);
                if (ret != null)
                {
                    MessageBox.Show("注册成功!");
                    return;
                }
                else
                {
                    MessageBox.Show("注册失败");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("连接服务器发生异常:" + ex.Message);
                return;
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //string uid = DES.DecryptDES("F449E953CDA93000", "11111111");
            HTTP.user = textBox1.Text;
            HTTP.pass = HTTP.EncryptMD5(HTTP.EncryptMD5(textBox2.Text));

            string pass = HTTP.EncryptMD5(HTTP.EncryptMD5(textBox2.Text));
            string ret  = null;

            try
            {
                ret = HTTP.Login2(textBox1.Text, pass, 0, "");
            }
            catch (Exception ex)
            {
                MessageBox.Show("失败原因:" + ex.Message + ",可能是服务器间歇性抽风或者版本更新,多试几次");
            }

            Form1 f = new Form1();

            this.Hide();
            f.Show();
        }