求一段VB登陆代码~需要MD5加密密码框的

来源:百度知道 编辑:UC知道 时间:2024/07/01 16:04:01
如题,想让程序访问远程access数据库,如HTTP://www.XXX.COM/DATA/DATA.MDB
表段为 user

要查找user表中的username和password与当前输入的text1和text2对比,text2为密码框

由于表中password是采用MD5加密的,特求一段VB代码,使其与 之验证!
要完整源码,发到huatanxier@163.com

Private Sub Command1_Click()

Dim md5Pwd As String

Dim rs As Recordset

Dim con As Connection

md5Pwd = Md5_String_Calc(Text2)
Set rs = con.Execute("select count(*) from user where username = '" & Text1.Text & "' and userpwd = '" & md5Pwd & "'")

If rs.RecordCount = 0 Then
MsgBox "用户名或者密码错误"
Else
MsgBox "登录成功"
End If

End Sub

'模块中

Option Explicit

Private Const OFFSET_4 = 4294967296#
Private Const MAXINT_4 = 2147483647
Private State(4) As Long
Private ByteCounter As Long
Private ByteBuffer(63) As Byte
Private Const S11 = 7
Private Const S12 = 12
Private Const S13 = 17
Private Const S14 = 22
Private Const S21 = 5
Private Const S22 = 9
Private Const S23 = 14
Private Const S24 = 20
P