尝试读取属性值时出现“Property 'InnerText' is WriteOnly”错误
这是我的 XML:
<?xml version="1.0" encoding="utf-8"?>
<products>
<product ID="11837">
<price currency="EUR">75.29</price>
<properties>
<property name="brand">
<value></value>
</property>
</properties>
<variations/>
</product>
</products>
要提取我做的价格:
node.SelectSingleNode("price").InnerText
返回“75.29”
但是当我这样做时:
node.Attributes("ID").InnerText
我得到错误:
属性“InnerText”是 WriteOnly
我看不出它为什么是只写的,也不知道如何更改它以便读取该值。