My code below reads a file offset and writes the hexadecimal values to the “MyGlobals.Hexbytes” variable …. How could I get it to write into an array instead?
Many Thanks
MyGlobals.Mapsettings_filepath = "C:\\123.cfg";
///////////////////////////// Read in the selected //////////////
BinaryReader br = new BinaryReader(File.OpenRead(MyGlobals.Mapsettings_filepath),
System.Text.Encoding.BigEndianUnicode);
for (int a = 32; a <= 36; a++)
{
br.BaseStream.Position = a;
MyGlobals.Hexbytes += br.ReadByte().ToString("X2") + ",";
}
Make
MyGlobals.Hexbytesto beList<string>instead then:Later to display it, use
String.Joinlike this: