不明白为什么老是出现异常?
Private Function MD5StringArray(strInput As String) As Byte()
Dim intLoop As Integer
Dim bytbuffer() As Byte
ReDim bytbuffer(Len(strInput))
For intLoop = 0 To Len(strInput) - 1
bytbuffer(intLoop) = Asc(Mid(strInput, intLoop + 1, 1))
Next intLoop
MD5StringArray = bytbuffer
End Function
Private Function MD5StringArray(strInput As String) As Byte()
Dim intLoop As Integer
Dim bytbuffer() As Byte
ReDim bytbuffer(Len(strInput))
For intLoop = 0 To Len(strInput) - 1
bytbuffer(intLoop) = Asc(Mid(strInput, intLoop + 1, 1))
Next intLoop
MD5StringArray = bytbuffer
End Function
是不是strInput含有中文啊
strInput中没有中文的。
最好用StrConv(strInput, vbUnicode)转换成unicode格式。
Dim bytbuffer() As Byte
bytbuffer = StrConv(strInput, vbFromUnicode)
MD5StringArray = bytbuffer
End Function