我在使用这行代码的路径中收到错误的非法字符
var doc = XDocument.Load(openBatch.GetOpenBatchSummary("xxxx", "xxxx", "xxxx", "", "", ""));
var summary = from r in doc.Descendants("OpenBatchSummary")
select new
{
PaymentTypeID = r.Element("Payment_Type_ID"),
Return = r.Element("Return"),
Sale = r.Element("Sale"),
};
foreach (var i in summary)
{
ListViewItem it = new ListViewItem(i.PaymentTypeID.ToString());
it.SubItems.Add(i.Sale.ToString());
it.SubItems.Add(i.Return.ToString());
listView1.Items.Add(it);
}
但是当我通过这行代码测试时,有 xml 数据
var test = openBatch.GetOpenBatchSummary("xxx", "xxxx", "xxx", "", "", "");
MessageBox.Show(test);
这是输出: