c#大文件拷贝详细
来源:互联网 发布:淘宝店铺违规考试答案 编辑:程序博客网 时间:2024/06/05 08:32
using System;using System.Collections.Generic;using System.Text;using System.IO;namespace 大文件拷贝{ class Program { static void Main(string[] args) { string source = @"F:\娱乐\电影Movie\flipped.rmvb"; string target = @"F:\flipped.rmvb"; CopyFile(source, target); Console.WriteLine("拷贝完毕!"); Console.ReadKey(); } private static void CopyFile(string source, string target) { //创建一个读文件的流 using (FileStream fsread = new FileStream(source, FileMode.Open)) { //创建一个写文件流 using (FileStream fswrite = new FileStream(target, FileMode.Create)) { //创建一个读取文件、写入文件的一个缓冲区 //设置缓冲区大小,每次读取内容放到缓冲区中 byte[] buffer = new byte[1024 * 1024 * 10];//10MB long len = fsread.Length; //开始读取 while (true) { //r 表示本次读到的字节数 int r = fsread.Read(buffer, 0, buffer.Length); if (r <= 0) //已经到了文件末尾 { break; } else //读到了内容 { fswrite.Write(buffer, 0, r); long allong = fswrite.Length; //已经拷贝的长度 double proc = (double)allong / len; Console.WriteLine("复制进度:" + proc + "%"); } } } } } }}
0 0
- c#大文件拷贝详细
- C#实现大文件拷贝
- C#实现大文件拷贝
- C# 最快的大文件拷贝方法
- C#谈文件操作NO2(大文件拷贝)
- Java拷贝大文件
- filechannel拷贝大文件
- A06_大文件拷贝
- c#文件拷贝
- VB断点拷贝大文件
- 高效的大文件拷贝
- 高效的大文件拷贝
- 高效的大文件拷贝
- NSFileHandle拷贝大文件+多线程
- 远程桌面无法拷贝大文件
- 远程桌面无法拷贝大文件
- C# 多线程目录拷贝 文件拷贝
- 利用C# 实现文件拷贝
- 接口的相关知识总结
- Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
- 构造函数中的throw
- Nt Kernel & System 占用80端口
- vim配置
- c#大文件拷贝详细
- 1. 函数的定义和调用
- Erlang环境搭建 for mac os
- mplayer编程模式控制命令
- SqlDateTime溢出错误 解决
- 无法嵌入互操作类型
- 正则应用之——日期正则表达式
- R Q&A 备查(持续更新整理中)
- 设计模式六大原则