FileStream流讀取

p1016520發表於2018-12-06
using (FileStream fread = new FileStream(@"C:Userskyp10Desktop1、復.avi", FileMode.OpenOrCreate, FileAccess.Read))
 {
     using (FileStream fwrite = new FileStream(@"C:Userskyp10Desktop
ew.avi", FileMode.OpenOrCreate, FileAccess.Write))
     {
       while (true)
        {
           byte[] buffer = new byte[1024 * 1024 * 5];
           int r = fread.Read(buffer, 0, buffer.Length);
           if (r == 0)
           {
            break;
        }
       fwrite.Write(buffer, 0, r);
    }                 
    }
}

 

相關文章