class Program
    {
        static void Main(string[] args)
        {
            string source = @"mana.mp4";
            string target = @"fu.mp4";
            CopyFile(source, target);
            Console.WriteLine("复制成功");
            Console.ReadKey();
        }
        public static void CopyFile(string soucre, string target)
        {
            FileStream fsRead = new FileStream(soucre, FileMode.Open, FileAccess.Read);
            FileStream fsWrite = new FileStream(target,FileMode.OpenOrCreate,FileAccess.Write);
            byte[] buffer = new byte[1024*1024*5];
            while (true)
            {
                int r = fsRead.Read(buffer, 0, buffer.Length);
                if (r == 0)
                {
                    break;
                }
                fsWrite.Write(buffer, 0, r);
            }
        }
    }

 

相关文章:

  • 2022-01-28
  • 2021-09-23
  • 2022-01-19
  • 2021-06-12
  • 2022-02-13
  • 2021-11-16
猜你喜欢
  • 2021-11-17
  • 2021-12-18
相关资源
相似解决方案