C# FileStream大文件拷贝

FileStream fsRead = new FileStream(@"C:\Users\Administrator\Desktop\1.wmv", FileMode.Open);

byte[] buffer=new byte[1024*1024];
int length;
FileStream fsWrite = new FileStream(@"C:\Users\Administrator\Desktop\111.wmv", FileMode.Create);
do {
length = fsRead.Read(buffer, 0, buffer.Length);
fsWrite.Write(buffer, 0, length);
}
while (length==buffer.Length);
fsRead.Dispose();
fsWrite.Dispose();
MessageBox.Show("OK啦");
Application.Exit();

posted @ 2024-07-05 17:13  崇尚技术  阅读(5)  评论(0编辑  收藏  举报