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
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
MD52 = MD52.Trim().Substring(0, 32).ToUpper
read1 = read1.Trim().Substring(0, 32).ToUpper
If MD52 = read1 Then
MsgBox("ok")
End If
#11
[Quote=引用 6 楼 dyc136mm 的回复:]请问这该怎么处理?
反正 MD5 是定长的,直接截断,简单粗暴。
MD52 = MD52.Trim().Substring(0, 32).ToUpper
read1 = read1.Trim().Substring(0, 32).ToUpper
If MD52 = read1 Then
MsgBox("ok")
End If
#1
你把两个字符串的值贴出来看看
#2
你把两个字符串的值贴出来看看
这俩值是取自不同位置,是两个变量
#3
你把两个字符串的值贴出来看看
其中前一个是计算得来的,后一个用同样算法记录在文件得来的
#4
你把两个字符串的值贴出来看看
这俩值是取自不同位置,是两个变量
你调试看看两个变量的值 啊,首先比较一下两个字符串的长度看看是否相等
#5
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
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