I'm trying to output binary file information something like this:
File size : 5 KB
Start : 0x00
End: 0x 20
But I don't really know how to output the end of file.
Hope somebody can help me.
Thanks.
public static void binaryread(string file)
{
FileStream fs;
BinaryReader br;
FileInfo f;
try
{
fs = new FileStream(file, FileMode.Open, FileAccess.Read);
br = new BinaryReader(fs);
f = new FileInfo(file);
long s1 = f.Length;
//string start = Convert.ToString(fs.Seek(0, SeekOrigin.Begin));
//string end = Convert.ToString(fs.Seek(0, SeekOrigin.End));
Console.WriteLine("File size : " + FormatBytes(s1));
Console.WriteLine("Start : " + HexConverted(start));
Console.WriteLine("End : " + HexConverted(end));
//}
}
}