<linhua MsgCounts="1" lastTime="2007-4-23 14:02:53">
<t2007-4-23>
</t2007-4-23>
</linhua> XPathDocument docXPath = new XPathDocument(Server.MapPath(filepath));
XPathNavigator navXPath = docXPath.CreateNavigator();
XPathExpression expXPath = navXPath.Compile("@lastTime/text()");
string strLastTime = navXPath.Evaluate(expXPath).ToString();例如上面的xml结构,我想用 XPathNavigator获取里面的lastTime属性值,
不知道xpath怎么写???
<t2007-4-23>
</t2007-4-23>
</linhua> XPathDocument docXPath = new XPathDocument(Server.MapPath(filepath));
XPathNavigator navXPath = docXPath.CreateNavigator();
XPathExpression expXPath = navXPath.Compile("@lastTime/text()");
string strLastTime = navXPath.Evaluate(expXPath).ToString();例如上面的xml结构,我想用 XPathNavigator获取里面的lastTime属性值,
不知道xpath怎么写???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货