我必须从 URL 读取 CSV 文件,例如:http://somedomain.com/getdata.aspx?p1=param1&p2=param2
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(_serviceUrl);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
StreamReader sr = new StreamReader(resp.GetResponseStream());
CsvReader csvread = new CsvReader(sr, new CsvConfiguration()
{
});
List<Entity> record = csvread.GetRecords<Entity>().ToList();
sr.Close();
但我没有运气
,标题字段是<...>
这样的:
<Field1>;<Field2>;<Field3>
和数据
stringValue;777;anotherStringValue
有什么帮助吗?