|
-
Sep 8th, 2003, 02:27 PM
#1
Thread Starter
Addicted Member
get bytes from file
Hi,
I know how to do this with VB6 but have not figured it out with VB.NET, any help would be much appreciated.
I have a bitmap on the server which the VB.NET app needs to open and get all the bytes to an array for processing.
Here's the VB6 code I used for the old version:
Code:
Open strFile For Binary As #f
Get #f, , sArray()
Close #f
and here's how far I've gotten with VB.NET:
Code:
FileOpen(1, SrcFile, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared, -1)
'WHAT GOES HERE?
FileClose(1)
Thanks for your help.
- Jake
-
Sep 8th, 2003, 02:30 PM
#2
New Member
here is a thread doing wat your trying to do I think http://www.vbforums.com/showthread.p...hreadid=259800
-
Sep 8th, 2003, 02:37 PM
#3
Thread Starter
Addicted Member
that's close but I just want to get all bytes from the file into any array. I don't want any one section of the bytes, I want them all.
- J
-
Sep 8th, 2003, 06:42 PM
#4
I wonder how many charact
VB Code:
Dim fs As New FileStream("C:\test.tst", FileMode.Open)
Dim r(fs.Length) As Byte
fs.Read(r, 0, fs.Length - 1)
fs.Close()
'r now contains all bytes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|