Click here to Skip to main content
15,913,487 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 7:38
who needs to know?18-Feb-08 7:38 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 7:41
who needs to know?18-Feb-08 7:41 
GeneralRe: Binary File Parser Pin
Steve Westbrook18-Feb-08 8:00
Steve Westbrook18-Feb-08 8:00 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 8:03
who needs to know?18-Feb-08 8:03 
GeneralRe: Binary File Parser Pin
Steve Westbrook18-Feb-08 8:25
Steve Westbrook18-Feb-08 8:25 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 8:04
who needs to know?18-Feb-08 8:04 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 7:47
who needs to know?18-Feb-08 7:47 
GeneralRe: Binary File Parser Pin
Steve Westbrook18-Feb-08 8:09
Steve Westbrook18-Feb-08 8:09 
Dim fs As new IO.FileStream("[Path Here]", IO.FileMode.Open)
Dim b(fs.Length - 1) As Byte
fs.Read(b, 0, fs.Length - 1)
Dim ba As New BitArray(b)

The io.filestream is a fairly abstract concept. A "Stream" in VB is a one-way conduit between object X and the program - a filestream can be used for input or output, depending on the argument supplied. In this case, you're only reading, so we specify IO.FileMode.Open because we want to read from the file.
From here, we
1. create an array of bytes - dim b(size) as byte
2. fill that array from the file (fs.read)
3. use the array now containing the file to fill the bitarray.

You couldn't do this from a textbox because a textbox contains characters, not bits or bytes.

I suggest reading up on the concepts behind this for a little while before continuing - these are fairly advanced concepts if one is not familiar with them, and what you are doing will take considerably more code than the four lines supplied here.
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 8:18
who needs to know?18-Feb-08 8:18 
GeneralRe: Binary File Parser Pin
Steve Westbrook18-Feb-08 8:27
Steve Westbrook18-Feb-08 8:27 
GeneralRe: Binary File Parser Pin
who needs to know?18-Feb-08 8:42
who needs to know?18-Feb-08 8:42 
QuestionRe: Binary File Parser [modified] Pin
who needs to know?18-Feb-08 9:02
who needs to know?18-Feb-08 9:02 
GeneralRe: Binary File Parser Pin
MikeMarq17-Feb-08 18:22
MikeMarq17-Feb-08 18:22 
QuestionHow to close all open forms. Pin
coolsatty17-Feb-08 4:29
coolsatty17-Feb-08 4:29 
AnswerRe: How to close all open forms. Pin
Eslam Afifi17-Feb-08 8:06
Eslam Afifi17-Feb-08 8:06 
GeneralRe: How to close all open forms. Pin
coolsatty17-Feb-08 23:07
coolsatty17-Feb-08 23:07 
AnswerRe: How to close all open forms. Pin
Eslam Afifi18-Feb-08 11:01
Eslam Afifi18-Feb-08 11:01 
GeneralRe: How to close all open forms. Pin
coolsatty18-Feb-08 18:23
coolsatty18-Feb-08 18:23 
AnswerRe: How to close all open forms. Pin
Eslam Afifi18-Feb-08 20:06
Eslam Afifi18-Feb-08 20:06 
GeneralRe: How to close all open forms. Pin
coolsatty19-Feb-08 23:59
coolsatty19-Feb-08 23:59 
GeneralRe: How to close all open forms. Pin
Eslam Afifi20-Feb-08 9:17
Eslam Afifi20-Feb-08 9:17 
QuestionHow can I correct these 5 lines of code in vb.net Pin
Gjm17-Feb-08 4:22
Gjm17-Feb-08 4:22 
AnswerRe: How can I correct these 5 lines of code in vb.net Pin
Guffa17-Feb-08 4:33
Guffa17-Feb-08 4:33 
GeneralRe: How can I correct these 5 lines of code in vb.net Pin
Fawxes18-Feb-08 4:15
Fawxes18-Feb-08 4:15 
GeneralPrepare an Evaluation Copy of a Windows based Application which is developed by using VB .Net 2003 and SQL Server2000 Pin
joby10017-Feb-08 0:50
joby10017-Feb-08 0:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.