我有以下示例xml
文件
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<IResponse xmlns:xsi="http://www.w3.org/2001/XMLScheminstance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Language>en</Language>
<Code>Approved</Code>
<Message> Approved</Message>
<Info xsi:type="Info">
<Number>11</Number>
<ExpiryDate year="10" month="8" />
<StartDate year="7" month="8" />
<currency="GBP">36.00</currency>
<ACode>096392</ACode>
</IResponse>
如何在treeview
控制中显示节点和子元素以及list view
中的值?
public void Deserialize()
{
XmlReader reader = XmlReader.Create(this.filePath);
XmlSerializer serializer = new XmlSerializer(typeof(Response));
if (serializer.CanDeserialize(reader))
{
Response obj = serializer.Deserialize(reader) as Response;
// obj consists of xml file nodes and i want to display this in treeview
// control and values in between them as list view .
}
else
{
iccTransactionResponseBindingSource.DataSource = null;
}
}