/// <summary> /// 手机动态码登录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void btn_DyLogin_Click(object sender, EventArgs e) { btn_AcquireValiCode.Text = "获取验证码"; btn_AcquireValiCode.BackColor = Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(122)))), ((int)(((byte)(195))))); string tel = txt_Phone.Text.ToString().Trim(); Boolean isRemember = false; // MessageBox.Show(tel); string password = txt_ValiCode.Text.ToString().Trim(); string para = "mobile=" + tel + "&dynamicPassword="******"&isRemember=" + isRemember; string data = CommonService.remote("web/login/dynamic.do", para, "login"); Result objs = JsonHelper.Json2Object <Result>(data); currentUser = new User(); currentUser.Tel = tel; currentUser.Password = password; //MessageBox.Show(data); if (objs.isSuccess == "True") { FloatWin fw = new FloatWin(this, currentUser); fw.Show(); this.Hide(); } else { TipFrm tipFrm = new TipFrm(objs.description); DialogResult result = tipFrm.ShowDialog(); //Messagebox.Show(objs.description, "提示", Messagebox.MyButtons.OK, Messagebox.MyIcon.Information); } }
//登陆事件 private void btn_Login_Click(object sender, EventArgs e) { string tel = txt_Phone.Text.ToString().Trim(); string checkCode = txt_ValiCode.Text.ToString().Trim(); string password = txt_ReSetPwd.Text.ToString().Trim(); string confirmPassword = txt_SurePwd.Text.ToString().Trim(); //MessageBox.Show(tel+ checkCode+password + confirmPassword); string par = "mobile=" + tel + "&checkCode=" + checkCode + "&password="******"&confirmPassword="******"web/login/forget.do", par); Result objs = JsonHelper.Json2Object <Result>(data); currentUser = new User(); currentUser.Tel = tel; currentUser.Password = password; // MessageBox.Show(objs.description); if (objs.isSuccess == "True") { FloatWin fw = new FloatWin(this, currentUser); fw.Show(); this.Hide(); } else { TipFrm tipFrm = new TipFrm(objs.description); DialogResult result = tipFrm.ShowDialog(); //DialogResult result = Messagebox.Show(objs.description, "提示", Messagebox.MyButtons.OK, Messagebox.MyIcon.Information); } }
private void createFloatWin(int isAutoLogin = 0) { if (fw == null || fw.IsDisposed || type == 1) { fw = null; fw = new FloatWin(this, currentUser, isAutoLogin); } this.Hide(); fw.Show(); fw.Activate(); }