Private Sub LRbtn_Click(sender As Object, e As EventArgs) Handles LRbtn.Click
OpenFileDialog1.Title = "Please Select a File"
OpenFileDialog1.ShowDialog()
Dim filename As String = OpenFileDialog1.FileName
Dim fs As FileStream = New FileStream(filename, FileMode.Open)
Dim br As BinaryReader = New BinaryReader(fs)
br.BaseStream.Seek(verOffset, SeekOrigin.Begin)
a = br.ReadInt32()
verLabel.Text = hex2ascii(Hex(a))
br.Close()
fs.Close()
End Sub
我正在打开并二进制读取一个文件,然后我在给定地址读取 4 个字节。
因此,例如,变量a
可能是1163022402
转换为十六进制的变量是45,52,50,42
转换a
为十六进制后,我需要反转字节以获得42,50,52,45
我是VB的新手,我正在学习它,我该怎么办?谢谢!