private byte[] StreamFile(string filename) { FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read); // Create a byte array of file stream length byte[] byteData = new byte[fs.Length]; //Read block of bytes from stream into the byte array fs.Read(byteData, 0, System.Convert.ToInt32(fs.Length)); //Close the File Stream fs.Close(); return byteData; //return the byte data }
File.ReadAllBytes(filename);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)