The following code reads a (small) binary file and stores it into a variable (Buffer). Use this code only for small files, because it will read the whole file at all and when you try to read a BIG file it will screw up you system

GeSHi (vb):
Dim FileNo As Long
Dim FileSize As Long
Dim Buffer As String
Dim CharNo As Long, Char As String * 1
FileNo = FreeFile ' Get next available file number.
Open FileName For Binary Access Read Shared As #FileNo
FileSize = LOF(FileNo) ' Determine how large the file is (in bytes).
Buffer = Space$(FileSize) ' Set our buffer (string) to that length.
' The length of the string (Buffer) determines how many bytes are read...
Get #FileNo, , Buffer ' Grab a chunk of data from the file.
Close #FileNo
Created by GeSHI 1.0.7.20