仔细检查了,之前登录没有问题,也没有改变任何代码...
出错代码如下

此主题相关图片如下:qq图片20130824182351.jpg
Dim dr As DataRow
Dim Ok As Boolean
Dim zhanghao As String = e.Form.Controls("账号1").Value
Dim mima As String = e.Form.Controls("密码1").Value
If zhanghao = Nothing Then
MessageBox.Show("请输入您的登录账号!", "错误提示!",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
ElseIf mima = Nothing Then
MessageBox.Show("请输入您的登录密码!", "错误提示!",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
DataTables("用户表").LoadFilter= "[ID] = '" & zhanghao & "'"
DataTables("用户表").Load
dr = DataTables("用户表").Find("[ID] = '" & zhanghao & "'")
If dr Is Nothing Then
Messagebox.show("登陆账号和密码不一致!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
ElseIf dr("密码") <> MD5Encrypt(mima) Then
Messagebox.show("登陆账号和密码不一致!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
ElseIf dr("离职") = True Then
Messagebox.show("该账号已经被锁定,禁止登录!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
ElseIf dr("ID")="FS0000"
Dim n As WinForm.TextBox = e.Form.Controls("账号1")
SaveConfigValue("Username",n.Text)
basemainform.visible=False
e.Form.close
Else
Dim n As WinForm.TextBox = e.Form.Controls("账号1")
SaveConfigValue("Username",n.Text)
e.Form.BaseForm.Hide()
e.Form.close
Forms("主界面").Open()
End If
End If