如何使用Linq To Access检索元素客户,结果和原因的值。
<?xml version="1.0"?>
<!DOCTYPE CreateAccount>
<CreateAccount>
<Customer>tonytsund</Customer>
<Result>Failed</Result>
<Reason>Reseller/Password combination unknown</Reason>
</CreateAccount>
答案 0 :(得分:0)
试试这个:
XElement xe = XElement.Load(ur xml);
var CusValue = from a in xe.Elements("Customer")
select a.Value;
var ResultValue= from a in xe.Elements("Result")
select a.Value;
Var ReasonValue= from a in xe.Elements("Reason")
select a.Value;