I am trying to read/write files using ReadByte
method. code is working but I have noticed that they are not available after process.I cant open them.I images not displaying.what am i doing wrong again and again.
if (openFileDialog1.ShowDialog() == DialogResult.OK) {
if (saveFileDialog1.ShowDialog() == DialogResult.OK) {
FileStream fsRead =
new FileStream(openFileDialog1.FileName, FileMode.Open);
FileStream fswrite =
new FileStream(saveFileDialog1.FileName, FileMode.Create);
if (fsRead.Position != fsRead.Length) {
byte b = (byte)fsRead.ReadByte();
fswrite.WriteByte(b);
}
}
}