W
wavemill
Hello!
I would like copy a file , but i don't want use File.Copy.(in the
future i would like encrypt the file..)
This my code:
FileStream fs = new FileStream("\\Program
Files\\SmartDeviceApplicationPpc\\myBmp1.bmp", FileMode.Open,
FileAccess.Read);
FileStream fsWrite = new FileStream("\\Program
Files\\SmartDeviceApplicationPpc\\myBmp2.bmp", FileMode.Create,
FileAccess.Write,FileShare.Read);
BinaryReader r = new BinaryReader(fs);
BinaryWriter rw = new BinaryWriter(fsWrite);
int lg = Convert.ToInt32(fs.Length);
byte[] bytes = new byte[lg];
fsWrite.Write(bytes,0,lg);
for (int i = 0; i < fs.Length; i++)
{
byte mybyte = (byte)fs.ReadByte();
fsWrite.WriteByte(mybyte);
}
My file is copy but he is not complete and i can't see mybmp!
have you got any idea?
best regards
j.berdoues
I would like copy a file , but i don't want use File.Copy.(in the
future i would like encrypt the file..)
This my code:
FileStream fs = new FileStream("\\Program
Files\\SmartDeviceApplicationPpc\\myBmp1.bmp", FileMode.Open,
FileAccess.Read);
FileStream fsWrite = new FileStream("\\Program
Files\\SmartDeviceApplicationPpc\\myBmp2.bmp", FileMode.Create,
FileAccess.Write,FileShare.Read);
BinaryReader r = new BinaryReader(fs);
BinaryWriter rw = new BinaryWriter(fsWrite);
int lg = Convert.ToInt32(fs.Length);
byte[] bytes = new byte[lg];
fsWrite.Write(bytes,0,lg);
for (int i = 0; i < fs.Length; i++)
{
byte mybyte = (byte)fs.ReadByte();
fsWrite.WriteByte(mybyte);
}
My file is copy but he is not complete and i can't see mybmp!
have you got any idea?
best regards
j.berdoues