using System; using System.IO; class Program { static void Main(string[] args) { // Open a file for reading FileStream fs = new FileStream("test.bin", FileMode.Open); BinaryReader br = new BinaryReader(fs); // Perform some read operations // Close the BinaryReader object br.Close(); } }
using System; using System.IO; class Program { static void Main(string[] args) { // Open the file for reading FileStream fs = new FileStream("test.bin", FileMode.Open); BinaryReader br = new BinaryReader(fs); // Read the contents of the file byte[] data = br.ReadBytes((int)fs.Length); // Close the BinaryReader object br.Close(); } }Both examples use the System.IO namespace, which is part of the .NET Framework Class Library.
public Close ( ) : void | ||
return | void |