下面的代码不想编译。我收到一条错误消息:
'System.Collections.Generic.List.Add(string[]) 的最佳重载方法匹配有一些无效参数
但我看不出有什么问题。有什么建议么?
public static List<string[]> ReadFromDelimitedFile (string Path)
{
int i=0;
List<string[]> AllContracts = new List<string[]>();
using (TextFieldParser parser = new TextFieldParser(Path))
{
parser.Delimiters = new string[] { "\t" };
while (true)
{
AllContracts.Add(i)= parser.ReadFields();
if (AllContracts.Add(i) == null)
{
break;
}
i++;
}
}
return AllContracts;
}