It’s easy to read a file into a byte array.  Just use the File.ReadAllBytes static method.  This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file.

string filePath = @"C:test.doc";
byte[] byteArray = File.ReadAllBytes( filePath );

Share and Enjoy:
  • Digg
  • Twitter
  • Facebook
  • Reddit
  • StumbleUpon
  • LinkedIn
  • Google Bookmarks
  • Slashdot