Edit byte in file

So I have no problem reading the byte in this file I want, but I'm having difficulty editing it with VB.NET.

(For example) The value is 0B in hex and I have a combobox populate with possible replacements for the byte - say 9.  They are in decimal format and I want them to be able to be selected, then switched to hex format and replace the byte that I have already previously read.  So in this instance, 0B becomes 09 after 9 is selected in the combobox and a button is pushed.

Do I need to read the byte first to know which one to replace?

Any help is appreciated!
Who is Participating?
nffvrxqgrcfqvvcConnect With a Mentor Commented:
You can use either BitConverter Class ToString() method or X2 hexadecimal format specifier.

BitConverter Class

Open in new window

jasgiv1122Author Commented:
How can I determine where in the file it puts the formatted number?  I need to read the first byte in the file and replace it with my newly formatted text.

jasgiv1122Connect With a Mentor Author Commented:
I figured the rest out. Thanks
jasgiv1122Author Commented:
Answered half of my question.  I used Writebyte to solve the rest of my problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.