Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
'###############################################利用web service实现用户验证############################
'Dim ws As New zyWindowsApplication.localhost.Service1()
'Dim PassFormate As String
'PassFormate = EncryptPassword(txtPass.Text, "md5") '//////////或者是EncryptPassword(uid.Text, "sha1")
'If ws.Userlogin(txtUser.Text, PassFormate) = True Then
''Dim fmain As New frmMain()
''fmain.Show()
''Me.Hide()
'Me.DialogResult = DialogResult.Yes
'Else
' MessageBox.Show("用户明或口令错误,请重新输入!")
'End If
'#######################################################################################################
dbda_user.SelectCommand.Connection = conn
conn.Open()
dbda_user.SelectCommand.CommandText = "select * from myuser where userName='" + txtUser.Text + "' and userpassword='" + txtPass.Text + "'"
'' dbda_user.SelectCommand.CommandText = "select * from myuser where userName=? and userpassword=?"
''dbda_user.SelectCommand.Parameters("username").Value = txtUser.Text
''dbda_user.SelectCommand.Parameters("userpassword").Value = txtPass.Text
dbda_user.SelectCommand.ExecuteNonQuery()
Dim users As New ds_user()
dbda_user.Fill(users)
If users.myuser.Count >= 1 Then
myUserQX = users.Tables("myuser").Rows(0).Item("usertype")
'MessageBox.Show(myUserQX)
Me.DialogResult = DialogResult.Yes
conn.Close()
myUserName = txtUser.Text
lklog = New Bigeagle.Util.Log(Application.StartupPath + "\event.log")
lklog.Write("用户" + myUserName + "成功登录!")
Else
conn.Close()
txtUser.Text = ""
txtPass.Text = ""
txtUser.Focus()
MessageBox.Show("用户名或口令错误,请重新输入!")
lklog = New Bigeagle.Util.Log(Application.StartupPath + "\event.log")
lklog.Write("用户" + txtUser.Text + "登录失败!")
End If