16,721
社区成员




Imports System.Text.Encoding
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MD52 As String = "D41D8CD98F00B204E9800998ECF8427E" & vbNullChar
Dim read1 As String = "D41D8CD98F00B204E9800998ECF8427E"
'这两个值“看起来”一样'
MsgBox(MD52)
MsgBox(read1)
'用下面的方式可以进行区别'
Debug.Print(BitConverter.ToString(ASCII.GetBytes(MD52)))
Debug.Print(BitConverter.ToString(ASCII.GetBytes(read1)))
End Sub
End Class
44-34-31-44-38-43-44-39-38-46-30-30-42-32-30-34-45-39-38-30-30-39-39-38-45-43-46-38-34-32-37-45-00
44-34-31-44-38-43-44-39-38-46-30-30-42-32-30-34-45-39-38-30-30-39-39-38-45-43-46-38-34-32-37-45
你把两个字符串的值贴出来看看
你把两个字符串的值贴出来看看
[Quote=引用 6 楼 dyc136mm 的回复:]请问这该怎么处理? [/Quote] 反正 MD5 是定长的,直接截断,简单粗暴。MD52 = MD52.Trim().Substring(0, 32).ToUpper read1 = read1.Trim().Substring(0, 32).ToUpper If MD52 = read1 Then MsgBox("ok") End If
MD52 = MD52.Trim().Substring(0, 32).ToUpper
read1 = read1.Trim().Substring(0, 32).ToUpper
If MD52 = read1 Then
MsgBox("ok")
End If
Imports System.Text.Encoding Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MD52 As String = "D41D8CD98F00B204E9800998ECF8427E" & vbNullChar Dim read1 As String = "D41D8CD98F00B204E9800998ECF8427E" '这两个值“看起来”一样' MsgBox(MD52) MsgBox(read1) '用下面的方式可以进行区别' Debug.Print(BitConverter.ToString(ASCII.GetBytes(MD52))) Debug.Print(BitConverter.ToString(ASCII.GetBytes(read1))) End Sub End Class
44-34-31-44-38-43-44-39-38-46-30-30-42-32-30-34-45-39-38-30-30-39-39-38-45-43-46-38-34-32-37-45-00 44-34-31-44-38-43-44-39-38-46-30-30-42-32-30-34-45-39-38-30-30-39-39-38-45-43-46-38-34-32-37-45