参考代码
Dim UserName As String = e.Form.Controls("textbox1").Value
Dim dr As DataRow
If UserName = "" Then
Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
dr = DataTables("基本信息").SQLFind("[姓名] = '" & UserName & "'")
If dr Is Nothing Then
Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
If e.Form.Controls("手机号").Value = dr("手机号") Then
_UserName = UserName
e.Form.Close
Else
Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If