How to modify a stationary location binary value in a file?

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

Hello,
I want to modify an binary value of stationary location in file. For
example, 100h=0F,
i want to change to 100h=FF, how to do?

Thank you very much
 
Hello,
I want to modify an binary value of stationary location in file. For
example, 100h=0F,
i want to change to 100h=FF, how to do?

Thank you very much

In order to change a value within the file, you must open the file,
seek to the point in the file you want to change, and then write your
changes. Finally, close the file. Be aware that writing to the
middle of the file does not do an "insert". It will overwrite data
that is already there. If the data that you are writing is the same
size as the data being overwritten, then it is ok. If the data being
written is larger or smaller, then you're going to have to use a
temporary file. Look at the classes in the System.IO namespace,
particularly the StreamReader and StreamWriter classes.

Chris
 
Thank you very much, successfully done.

Chris Dunaway said:
In order to change a value within the file, you must open the file,
seek to the point in the file you want to change, and then write your
changes. Finally, close the file. Be aware that writing to the
middle of the file does not do an "insert". It will overwrite data
that is already there. If the data that you are writing is the same
size as the data being overwritten, then it is ok. If the data being
written is larger or smaller, then you're going to have to use a
temporary file. Look at the classes in the System.IO namespace,
particularly the StreamReader and StreamWriter classes.

Chris
 
Back
Top