#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