何か間違ったことをしているような気がしますが、何が原因かわかりません。
これが私のコードです:
long offset = 0x009694E3;
long length = 0x02;
byte[] bytes = new byte[length];
// Create the memory-mapped file.
using (var mmf =
MemoryMappedFile.CreateFromFile(strFileName, FileMode.Open, "ISO"))
{
// Create a random access view, from the 256th megabyte (the offset)
// to the 768th megabyte (the offset plus length).
using (var accessor = mmf.CreateViewAccessor(offset, length))
{
// Make changes to the view.
for (long i = 0; i < length; i++)
{
bytes[i] = accessor.ReadByte(i);
dialogEdit.Text = bytes[i].ToString();
}
}
}
ファイルをロードすると、上記のオフセットのテキストは 0x22 0x44 (ASCII では "D) ですが、テキスト ボックスへの出力は "68" です...
バイトの仕組みを誤解していると思いますが、完全にはわかりません...
どんな助けでも大歓迎です!