【发布时间】:2011-09-12 10:21:48
【问题描述】:
<SMSWall run="yes" nonstop="False">
<starttime>10:15:25 PM</starttime>
<endtime>10:15:25 PM</endtime>
</SMSWall>
<MediaPlayer run="yes" nonstop="False">
<starttime>10:15:25 PM</starttime>
<endtime>10:15:25 PM</endtime>
</MediaPlayer>
<Bidding run="yes" nonstop="False">
<starttime>10:15:25 PM</starttime>
<endtime>10:15:25 PM</endtime>
</Bidding>
这是我的 xml 文件。现在我想读取 xml,将值存储在变量中(并且还希望从字符串中读取数据),然后保留 .xml 文件以便可以将其删除。我还想像读取节点一样明智地读取值:
XmlDocument document = new XmlDocument();
document.Load("Schedule.xml");
XmlNode ht=document.SelectSingleNode("SMSWall/@run");
【问题讨论】: