How to check certain bytes at an offset and set checkboxes accordingly

April 18, 2012 in answer

0 votes, 0.00 avg. rating (0% score)

ANSWER:

        file = File.Open(myFileLocation); 
        BinaryReader br = new BinaryReader(file);

        string hexcode1 = "0000A0E1";
        offset1 = 20334;

        file.Seek(offset1, SeekOrigin.Begin);

        String byteRead = br.ReadByte().ToString();

        mycheckbox.setChecked(hexcode1.equals(byteRead )); //setChecked or similar, not sure withtout looking.

by Doomsknight from http://stackoverflow.com/questions/10213341