M
martins
Hi,
I cannot make this VB6 code to work in VB.NET.
Dim buffer As String
Dim tmp_i As Long
Open FileName For Binary Access Read As #1
buffer = Input(FileLen(FileName), #1)
tmp_i = FileLen(FileName)
Close #1
I tried this :
Dim buffer As String
Dim tmp_i As integer
Dim idF As Integer = FreeFile()
FileOpen(idF, FileName, OpenMode.Binary, OpenAccess.Read)
Input(idF, buffer)
tmp_i = FileLen(FileName)
FileClose(idF)
but it doesn't read the file to the end...the resulting buffer lenght in VB6
is different
How can I read a binary file into a string type buffer ?
I cannot make this VB6 code to work in VB.NET.
Dim buffer As String
Dim tmp_i As Long
Open FileName For Binary Access Read As #1
buffer = Input(FileLen(FileName), #1)
tmp_i = FileLen(FileName)
Close #1
I tried this :
Dim buffer As String
Dim tmp_i As integer
Dim idF As Integer = FreeFile()
FileOpen(idF, FileName, OpenMode.Binary, OpenAccess.Read)
Input(idF, buffer)
tmp_i = FileLen(FileName)
FileClose(idF)
but it doesn't read the file to the end...the resulting buffer lenght in VB6
is different
How can I read a binary file into a string type buffer ?