好的,我想做的就是比较 vb.net 中的 2 字节数组。我尝试了这些代码:
If Byte.ReferenceEquals(bytearrayone, bytearraytwo) Then
MsgBox("Yes", MsgBoxStyle.Information)
Else
MsgBox("No", MsgBoxStyle.Critical)
End If
和
If Array.ReferenceEquals(bytearrayone, bytearraytwo) Then
MsgBox("Yes", MsgBoxStyle.Information)
Else
MsgBox("No", MsgBoxStyle.Critical)
End If
两个字节数组是相同的,一个数组从资源文件中获取字节,另一个从计算机中获取字节。出于测试目的,我在两个数组中使用了相同的文件,但根据提供的代码,我得到的只是 No。两者都具有相同的长度,我遍历了它们,它们在相同的点都有相同的字节。那怎么了?我应该使用什么代码?请帮我。