我对谅解有疑问,如何从XML读取数据。XML看起来像这样:<PosXML version="7.2.0"> <ReadCardResponse> <ReturnCode>1</ReturnCode> <Card> <Pan>222300******5062</Pan> <Expires>****</Expires> <CardName>MASTERCARD</CardName> <CardSource>2</CardSource> </Card> </ReadCardResponse></PosXML>我已经从流中加载了XML:XDocument doc;using (Stream responseStream = httpResponse.GetResponseStream()){ doc= XDocument.Load(responseStream);}试过这个,但是不起作用:XElement returnCode = doc.XPathSelectElement("ReturnCode")
- 2 回答
- 0 关注
- 109 浏览
添加回答
举报
0/150
提交
取消