我正在从远程服务器(arnd 9gb)读取一个大文本文件。
从远程服务器读取文件时,代码缺少大量文件并完成。当我将文件移动到本地服务器并从那里读取时,它会读取整个文件而没有任何问题。
示例:
Dictionary<string, string> NewFile = new Dictionary<string, string>();
string File = @"\\filesystem1\fileshare\rs\" + Session["Region"].ToString() + ".csv";
using (StreamReader str = new StreamReader(File, Encoding.ASCII))
{
string toread;
while ((toread = str.ReadLine()) != null) //str.Peek() >= 0)
{
//string[] line = str.ReadLine().Split(',');
string[] line = toread.Split(',');
NewFile.Add(line[2], line[0]);
}
}
从服务器读取时可能导致读取跳过行的任何想法?该文件实际上应该有大约250k条目,但我的var通常加载大约75k。
此致