各位杂样 自己做一个类似与 Dos 的copy功能
请各位帮帮忙
------解决方案--------------------FileStream vSourceFileStream = new FileStream(@ "c:\temp\temp.txt ",
FileMode.Open, FileAccess.Read, FileShare.Read);
FileStream vDestFileStream = new FileStream(@ "c:\temp\temp.bak ",
FileMode.OpenOrCreate, FileAccess.Write);
byte[] vBuffer = new byte[0x1000];
int vReadLength = vSourceFileStream.Read(vBuffer, 0, vBuffer.Length);
while (vReadLength > 0)
{
vDestFileStream.Write(vBuffer, 0, vReadLength);
vReadLength = vSourceFileStream.Read(vBuffer, 0, vBuffer.Length);
}
vSourceFileStream.Close();
vDestFileStream.Close();