Here ya go,
You will need to clean that up a little bit, but its a works...
-- Read
FileStream fs = new FileStream(@"C:\calc.exe", FileMode.OpenOrCreate,
FileAccess.Read);
byte[] MyData= new byte[fs.Length];
fs.Read(MyData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
-- Write
FileStream fs1 = new FileStream(@"C:\calc1.exe", FileMode.OpenOrCreate,
FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fs1);
bw.Write(MyData);
bw.Close();
fs1.Close();
Patrik Malmström said:
I've looked at them, but the exampel, wish I always use aren't very good
"Henrik Dahl" <
[email protected]> skrev i meddelandet
Patrick,
File.Copy.
More general: BinaryReader/BinaryWriter.
Best regards,
Henrik Dahl
How do I read, write a file binary?
I want to open, say, file.exe read it in to the program, then