我正在尝试读取二进制文件的第一个字,它告诉我该文件包含多少个步骤。在 VB.net 中处理二进制数据时,我完全是个新手
最好的办法是什么?我实际上只需要读取文件第一个单词的值——我不需要对它做更多的事情。
我找到了这段代码,但它只返回一个空字符串:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim readStream As FileStream
Dim msg As String
Try
readStream = New FileStream("C:\FreeStyler\Chases\Quadzilla - RedGreenBlue - Shrinking Squares (Pattern 23) - Static.chb", FileMode.Open)
Dim readBinary As New BinaryReader(readStream)
msg = readBinary.ReadString()
MsgBox(msg)
readStream.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
提前致谢 ...