FreamStream文件的分割
来源:互联网 发布:软件下载大全360 编辑:程序博客网 时间:2024/05/19 14:16
#region 文件分割
static void Main(string[] args)
{
string file = @"x.txt";
using (FileStream fileRead = new FileStream(file, FileMode.Open, FileAccess.Read))
{
//表示每个文件大小
long length = (int)Math.Ceiling(file.Length / 3 * 1.0);
byte[] bt=new byte[1024];
for (int i = 0; i < 3; i++)
{
int total = 0;
using (FileStream temp = new FileStream(file + i.ToString(), FileMode.Create, FileAccess.Write))
{
int count = 0;
while ((count = fileRead.Read(bt, 0, count)) > 0)
{
total += count;
temp.Write(bt, 0, count);
if (total >= length)
{
break;
}
}
}
}
}
Console.WriteLine("0k");
Console.ReadKey();
}
#endregion
- FreamStream文件的分割
- 文件分割的代码
- PHP 文件的分割
- 文件的分割
- 合并分割的文件
- java文件的分割
- 文件的分割
- 一个文件分割的程序
- 文件的合并与分割
- 文件的分割和合并
- 文件的合并与分割
- 文件的分割和合并
- 文件的分割与合并
- WinRAR的文件分割功能
- 文件的分割与合并
- PDF文件的分割方法
- 文件的分割与合并
- 文件的分割与合并
- Qtopia 2.2.0在OK6410平台的移植(三)运行一个简单的Helloworld
- Qtopia 2.2.0在OK6410平台的移植(四)LED测试
- qtopia移植笔记
- 第四周作业
- 声明,本人发的所有博客为转载
- FreamStream文件的分割
- lsof命令
- 七大主流排序算法时间效率比较(基于C语言)
- unity3d刚体和碰撞检测学习一:新建一个plane和一个sphere,却碰撞检测失败的问题
- StreamWriter(流形式写入文本文件)
- Oba's Google Style
- linux C C++ 字符集转换,UTF-8,GB2312
- 判断字符串的编码类型(GBK / UTF8)
- Windows Server 2012&R2超级虚拟化之十一 软件定义网络之网络虚拟化