if I have a existing binary file of 20 bytes, and I want to replace (over-write) portion of that file, say 4 bytes, from index 10 to index 13, how could I do that?
I understand that FileMode.Append could be used, but it always append at the end, with offset 0.
I would appreciate if some code samples are shown.
thanks.
(x)
foamy
2499
2499
You will probably need to read the file into memory, alter it and write the entire thing back

1 answers
I'd use a BinaryWriter for this and call the Seek() method on the underlying stream to move to the 11th byte in the file. Here's some code:
answered 2 years ago by:
17279
494
thanks, that is a neat solution. I find similar solution at http://www.neowin.net/forum/index.php?showtopic=609069