Beispiel #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;
            }
        }
Beispiel #2
0
        //
        public static void notification_post_devicetoken(string login_id, string password)
        {
            List <ReqParama> reqparams = new List <ReqParama>();

            reqparams.Add(new ReqParama("S", "nosessionid"));
            reqparams.Add(new ReqParama("login_id", login_id));
            reqparams.Add(new ReqParama("password", password));
            reqparams.Add(new ReqParama("app", "and"));

            string token;
            Random rd = new Random();

            byte[] bytes = Encoding.ASCII.GetBytes(HTTP.EncryptMD5(HTTP.code + login_id) + rd.Next(1000000).ToString());
            token = Convert.ToBase64String(bytes).Replace("\n", "");
            reqparams.Add(new ReqParama("token", token));

            string postdata = ma_prepare_request(reqparams);

            ma_request("/connect/app/notification/post_devicetoken?cyt=1", postdata);
        }
Beispiel #3
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();
        }
Beispiel #4
0
 public static string make_chk(string str)
 {
     return(HTTP.EncryptMD5(HTTP.EncryptMD5(str + str)).Substring(0, 5));
 }