我正在尝试阅读此 XML 文件:
<server>
<Version date="06/05/2013">2.5.4</Version>
<Lastfix path="\">Now reading basic config files! Read the README file!</Lastfix>
<Version date="07/05/2013">2.5.3</Version>
<Lastfix path="\wServer\ClientProcessor.cs">Fixed character creation bugs (related to mysql, download and import the new struct.sql file under db!)</Lastfix>
<Version date="06/05/2013">2.5.0</Version>
<Lastfix path="\">BIG stability fix, register fix, buy gold fix</Lastfix>
<Version date="02/05/2013">2.4.1</Version>
<Lastfix path="\wServer\realm\entities\player\Player.UseItem.cs">Almost finished dungeon keys!</Lastfix>
<Version date="30/04/2013">2.3.1</Version>
<Lastfix path="\wServer\realm\entities\player\Player.UseItem.cs">Dungeon keys now working!</Lastfix>
<Version date="30/04/2013">2.3.0</Version>
<Lastfix path="\wServer\realm\entities\player\Player.Chat.cs">Added /who, /tell, /server commands!</Lastfix>
</server>
但无法弄清楚如何获取版本和 lastfix 文本值!
我正在尝试这段代码。
XmlDocument version = new XmlDocument();
version.Load(path);
foreach (XmlNode node in version.SelectNodes("server"))
{
MessageBox.Show(node.SelectSingleNode("lastfix_date").InnerText);
}
但没有成功