[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Leo

8/25/2010 12:39:00 PM

I am trying to learn how to read binary files but can not seem to find
much out there. Can someone give me an example. I think for what I am
trying to read, a Byte array is best so if someone can give me a
generic example reading from a binary file into a byte array then that
would be wonderful.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


2 Answers

Dee Earley

8/25/2010 12:46:00 PM

0

On 25/08/2010 13:39, Leo wrote:
> I am trying to learn how to read binary files but can not seem to find
> much out there. Can someone give me an example. I think for what I am
> trying to read, a Byte array is best so if someone can give me a generic
> example reading from a binary file into a byte array then that would be
> wonderful.

Open, Get, Close
http://www.earlsoft.co.uk/tips/...

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

Karl E. Peterson

9/2/2010 11:14:00 PM

0

Leo wrote on 8/25/2010 :
> I am trying to learn how to read binary files but can not seem to find much
> out there. Can someone give me an example. I think for what I am trying to
> read, a Byte array is best so if someone can give me a generic example
> reading from a binary file into a byte array then that would be wonderful.

Private Function ReadFileB(ByVal FileName As String, Data() As Byte) As
Boolean
Dim hFile As Long
On Error GoTo Hell
hFile = FreeFile
Open FileName For Binary As #hFile
ReDim Data(0 To LOF(hFile) - 1) As Byte
Get #hFile, , Data
Close #hFile
Hell:
ReadFileB = Not CBool(Err.Number)
End Function

--
..NET: It's About Trust!
http://vfre...