Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.25 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Write byte array to middle of an existing file in C#.NET
  2. using (var stream = File.Open("file.dat", FileMode.Open))
  3. {
  4.     stream.Position = 100;
  5.     // Assuming data is the data you want to write to the file
  6.     stream.Write(data, 0, data.Length);
  7. }