当使用BinaryReader时,我可以读取文件,虽然我当前有问题显示从我在for循环中设置的偏移或参数中读取的十六进制值
OpenFileDialog ofd = new OpenFileDialog();
private void btnValue_Click(object sender, EventArgs e)
{
ofd.ShowDialog();
BinaryReader br = new BinaryReader(File.OpenRead(ofd.FileName));
String value = null;
for (int i = 0x28; i <= 0x35; i++)
{
br.BaseStream.Position = i;
value += br.ReadByte().ToString("X2");
}
br.Close();
lblValue.Text = Value;
}
我要显示的值应为十六进制格式“FF3D0EC1”。