private void btnReg_Click(object sender, EventArgs e) { string user_id = txtUser.Text.Trim(); string user_pwd = txPwd.Text; string ip_addr = txtIp.Text.Trim(); string mac_addr = txtMAC.Text.Trim(); //可以对用户名的密码进行加密操作,增加安全性 //user_pwd = AES.Test.AESEncrypt(user_pwd); //实例化Web服务对象 userinfoService us = new userinfoService(); string message = us.Register(user_id, user_pwd, ip_addr, mac_addr); MessageBox.Show(message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void Login() { string user_id = txtUser.Text.Trim(); string user_pwd = txtPwd.Text; //可以对用户名的密码进行加密操作,增加安全性 //user_pwd = AES.Test.AESEncrypt(user_pwd); userinfoService us = new userinfoService(); bool flag = us.Login(user_id, user_pwd); if (flag) { MessageBox.Show("登陆成功!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = System.Windows.Forms.DialogResult.OK; } else { MessageBox.Show("登录失败,用户名或密码错误", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }