Marook-Online
* 06.Feb.2012, 15:10 UTC+1
Welcome, Guest. Please login or register.
Username:
Password:

News: Back again Wink
Main Menu
  Navigation
   Downloads
     Tools
     Music Discs
     SMF Mods
     Trainer & Patches
     EgoShare Uploader
   Guestbook
   NoPaste
   User Map
   Gallery
  
   Malware Scan
   Hacker Blacklist
   Find Abusemail
Top Downloads
Support Me !
Help me by donating a small amount!



Advanced search

Google


Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read
28-Nov-2007 19:48
Marook
Administrator
*****
Offline Offline

Joined: 01-Jan-2005
Posts: 224


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 Wink

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

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net

MHD v2.1 © 2oo8 by Marook
32116 hacking attempts defended!