這裏是我的代碼讀取一個文本文件,這恰好是大於1GB,是管道分隔:Visual Studio 2012 Express對閱讀大文件有限制嗎?
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string strFilePath = @"C:\Users\Me\Desktop\123.txt";
private void button1_Click(object sender, EventArgs e)
{
var arrRawData = File.ReadLines(strFilePath).Select(line => line.Split('|')).ToArray();
}
}
}
當我按一下按鈕我得到這個錯誤:
"System.OutOfMemoryException' occurred in mscorlib.dll"
我有16GB的RAM ......我做錯了什麼?
哪條線給你這個錯誤 –
看到這個:http://stackoverflow.com/questions/1087982/single-objects-still-limited-to-2-gb-in-size-in- clr-4-0 –
[this](http://blogs.msdn.com/b/joshwil/archive/2005/08/10/450202.aspx)可能會有幫助.. –