468,735 Members | 2,169 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,735 developers. It's quick & easy.

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

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

May 15 '07 #1
2 1085
On May 15, 3:44 am, "Steven" <g...@163.comwrote:
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

May 15 '07 #2
Thank you very much, successfully done.

"Chris Dunaway" <du******@gmail.com写入消息
news:11**********************@h2g2000hsg.googlegro ups.com...
On May 15, 3:44 am, "Steven" <g...@163.comwrote:
>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
May 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Venkat | last post: by
reply views Thread by S.a.S. | last post: by
4 posts views Thread by knapak | last post: by
6 posts views Thread by | last post: by
7 posts views Thread by elliotng.ee | last post: by
7 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.