F
Freddy Coal
Hi, I'm trying to read a binary file of 2411 Bytes, I would like load all
the file in a String.
I make this function for make that:
'--------------------------
Public Shared Function Read_bin(ByVal ruta As String)
Dim cadena As String = ""
Dim dato As Array
If File.Exists(ruta) = True Then
dato = My.Computer.FileSystem.ReadAllBytes(ruta)
For Each dat As Byte In dato
cadena = cadena & Microsoft.VisualBasic.ChrW(dat)
Next
Return cadena
Else
Return "Error"
End If
End Function
'--------------------------
Well, my problem is that in the final string, some bytes in the string not
are the originals, How can correct that?.
Thanks in advance for any help.
Freddy Coal.
the file in a String.
I make this function for make that:
'--------------------------
Public Shared Function Read_bin(ByVal ruta As String)
Dim cadena As String = ""
Dim dato As Array
If File.Exists(ruta) = True Then
dato = My.Computer.FileSystem.ReadAllBytes(ruta)
For Each dat As Byte In dato
cadena = cadena & Microsoft.VisualBasic.ChrW(dat)
Next
Return cadena
Else
Return "Error"
End If
End Function
'--------------------------
Well, my problem is that in the final string, some bytes in the string not
are the originals, How can correct that?.
Thanks in advance for any help.
Freddy Coal.