[英]How do I set certain checkboxes of a checkedcomboboxedit UI item?
[英]How to check certain bytes at an offset and set checkboxes accordingly
我需要知道如何检查偏移量的字节。 我使用string hexcode1 = "0000A0E1";
字符串,即string hexcode1 = "0000A0E1";
偏移量为int offset1 = 30030;
我将如何检查在offset1处是否具有hexcode1。 请注意,我确实了解文件流和二进制写入器/读取器,但不知道如何将它们与字符串一起使用。 这就是我需要帮助的部分原因。
这应该可以解决问题。 使用二进制读取器,偏移文件,然后读取字节并转换为字符串,以与当前字符串进行比较。
file = File.Open(myFileLocation);
BinaryReader br = new BinaryReader(file);
string hexcode1 = "0000A0E1";
int offset1 = 20334;
file.Seek(offset1, SeekOrigin.Begin);
String byteRead = br.ReadByte().ToString();
mycheckbox.Checked = (hexcode1.Equals(byteRead));
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.