private void ButLogin_Click(object sender, EventArgs e) { #region If name and pass equal Empty if (this.txtname.Text.Trim().ToString() == string.Empty) { this.toolTip1.Show("用户名不能为空", this.txtname, 1500); return; } if (this.txtpass.Text.Trim().ToString() == string.Empty) { this.toolTip1.Show("密码不能为空", this.txtpass, 1500); return; } #endregion //this.panel1.Visible = false; SkyDriveWebClient client = new SkyDriveWebClient(); string name = this.txtname.Text.Trim().ToString(); string pass = this.txtpass.Text.Trim().ToString(); //BeginLogOn client.BeginLogOn(name, pass, new AsyncCallback((IAsyncResult result) => { if (name == "admin") { this.Invoke(new MethodInvoker(() => { new MainForm().Show(); this.Hide(); })); } else { MessageBox.Show("用户名或密码不正确!", "登录提示", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Invoke(new MethodInvoker(() => { this.PpLogin.Visible = false; this.PLogin.Visible = true; })); } })); this.PLogin.Visible = false; this.PpLogin.Visible = true; //this.progressBar1.Style = ProgressBarStyle.Marquee; }
posted on 2010-02-26 15:33 SonyXbox 阅读(194) 评论(0) 编辑 收藏 举报