Home All Groups Group Topic Archive Search About

read files in as literally bites

Author
5 Feb 2006 5:19 AM
iwdu15
hi, ive been trying to figure out how i can get any type of file read in as
literally bytes. i tried using the binary reader, but if there was text at
all in the file, all i got was the text and the encoding for it. i want to
read all files in as there bit values...how can i do this?
--
-iwdu15

Author
5 Feb 2006 5:50 AM
I Don't Like Spam
iwdu15 wrote:
> hi, ive been trying to figure out how i can get any type of file read in as
> literally bytes. i tried using the binary reader, but if there was text at
> all in the file, all i got was the text and the encoding for it. i want to
> read all files in as there bit values...how can i do this?

Use the StreamReader class.  Use the ReadBlock & Read methods.

You'll probably need the Convert class as well.

Hope it helps.

Chris
Author
5 Feb 2006 12:02 PM
Herfried K. Wagner [MVP]
"iwdu15" <jmmgoalsteratyahoodotcom> schrieb:
> hi, ive been trying to figure out how i can get any type of file read in
> as
> literally bytes. i tried using the binary reader, but if there was text at
> all in the file, all i got was the text and the encoding for it. i want to
> read all files in as there bit values...

Take a look at the 'FileStream' class.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>