我在下面的代碼讀取文件偏移量並將十六進制值寫入「MyGlobals.Hexbytes」變量....我怎樣才能將它寫入數組?C#將數據添加到數組?
非常感謝
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") + ",";
}
很難說出你想要什麼。你想改變'MyGlobals.Hexbytes'嗎?你想要什麼類型的陣列?一個字節數組,字符串數組等?請編輯您的問題以添加此信息。 –