|
-
Feb 14th, 2003, 07:02 AM
#1
Thread Starter
Hyperactive Member
Binary Files
hi,
Ok what I want to do is using an inputbox, enter the path of a file, I need to read it in as binary.
I want to then read 4 other files this way.
I will then need to add them to a new file called 'Agent01.bef'
I know I'll have to add a header to this file, which tells me how long the files are so I can get them out of this file again.
and then once the file (Agent01.bef) is created I want to be able to break the file apart again into its original four files.
how do I this?
Thanks
-
Feb 14th, 2003, 08:08 AM
#2
Sleep mode
Did you check BinaryReader & BinaryWriter Classes !
VB Code:
'reading
Dim BINread As New IO.BinaryReader(IO.File.OpenRead(path))
Dim str As String = BINread.ReadString()
.
.
'writing
Dim BINwrite As New IO.BinaryWriter(IO.File.OpenWrite(path))
BINwrite.WriteLine("A String")
BINwrite.WriteLine(12345)
-
Feb 14th, 2003, 08:13 AM
#3
Sleep mode
-
Feb 14th, 2003, 09:53 AM
#4
Thread Starter
Hyperactive Member
I did look in MSDN at the binaryreader/writer stuff, but I couldn't make sense of how to do it...
Thanks
-
Feb 14th, 2003, 10:05 AM
#5
Thread Starter
Hyperactive Member
to be honest, that code, doesn't help all it is, is a similar copy of what is in MSDN.
It writes the value
A String90
to a file?
I need to read in 'FileA' and 'FileB' and then output them into one one file 'FileC'
as well as attaching a header, which allows me to break them apart, back to their original files later.
I would also like to know how to do this.
Pirate your help has been great in the past, but maybe a bit of an explination of how to do these function may help.
thanks for your help.
-
Feb 14th, 2003, 12:17 PM
#6
Sleep mode
I haven't a clue about headers .This what I was talking about !I hope it helps !
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
|