to VB.NET?VB Code:
Open lpMP3File For Binary As #1 Get #1, 1, Buf Close #1
Printable View
to VB.NET?VB Code:
Open lpMP3File For Binary As #1 Get #1, 1, Buf Close #1
If I understand that vague function correctly , then it reads a binary file . Then , starts reading from the first byte (if it's not zero-based function) for 1 byte and save it in the Buf variable (which I suppose it's byte array) .
Based on this , this is how it should be in .NET .
VB Code:
Dim byts(1) As Byte Dim strem As IO.Stream = New IO.FileStream("c:\xxx.LLL", IO.FileMode.Open) strem.Read(byts, 1, 1) strem.Close() For Each s As Byte In byts MessageBox.Show(s.ToString) Next
ok here is a bigger part of the code, I'm showing this as I think the buffer must have at least 4096 bytes
VB Code:
Dim Buf As String '* 4096 Dim infoStr As String '* 3 Dim lpVBRinfo As VBRinfo Dim tmpByte As Byte Dim tmpNum As Byte Dim i As Integer Dim designator As Byte Dim baseFreq As Single Dim vbrBytes As Long Open lpMP3File For Binary As #1 Get #1, 1, Buf Close #1 For i = 1 To 4092 If Asc(Mid(Buf, i, 1)) = &HFF Then tmpByte = Asc(Mid(Buf, i + 1, 1)) If Between(tmpByte, &HF2, &HF7) Or Between(tmpByte, &HFA, &HFF) Then Exit For End If End If Next i
Ok , whatever the buffer size is , the idea is stil the same .