我有以下代码
using (StreamWriter streamwriter = new StreamWriter(savetopath))
{
using (CsvWriter csv = new CsvWriter(streamwriter))
{
List<string> columns = new List<string>();
foreach (DataColumn column in shopifyDatatable.Columns)
csv.WriteField(column.ColumnName.ToString());
csv.NextRecord();
foreach (DataRow row in shopifyDatatable.Rows)
{
for (var i = 0; i < shopifyDatatable.Columns.Count; i++)
{
csv.WriteField(row[i].ToString());
}
csv.NextRecord();
}
}
}
一切正常,但诸如 017825892588 之类的字段最终为 17825892588。
谁能帮我解决这个问题?