April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to write data to a binary file, with strong data typing.
Solution
Create a new System.IO.FileStream object that references the file. To write the file, wrap the FileStream in a System.IO.BinaryWriter and use the overloaded Write method. To read the file, wrap the FileStream in a System.IO.BinaryReader and use the Read method that corresponds to the expected data type.
How It Works
The .NET Framework allows you to write or read binary data with any stream by using the BinaryWriter and BinaryReader classes. When writing data with the BinaryWriter, you use the Write method. This method is overloaded to support all the common VB .NET data types, including strings, chars, integers, floating-point ...
Read now
Unlock full access