日期:2014-05-17 浏览次数:20397 次
string filepath = @"D:\11\aa.txt";//文件大概1G内
using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read))
{
byte[] buff = new byte[1024];
int datalength = 0;
int start=0;
string cellstr = "";
while ((datalength = fs.Read(buff,0, buff.Length)) > 0)
{
cellstr = Encoding.GetEncoding("gb2312").GetString(buff);
//处理
fs.Seek(start + datalength, SeekOrigin.Begin);
buff = new byte[1024];
}
}