c# - Var with XML after Digest Authentication -


after digest authentication:

var resulttext = digester.grabresponse("/blabla"); 

i have in var resultext:

<?xml version="1.0" encoding="utf-8"?> <response>  <hello>   <time>08:10</time>   <date>11.08.09</date>   <temp>35.5</temp>   <humi>37.7</humi>  </hello> </response> 

i tried fetch value of date xdocument didn't work.

this simple: -

xdocument xml = xdocument.parse(resulttext.tostring());  var date = (from n in xml.descendants("hello")             select n.element("date").value).singleordefault().tostring(); 

you need use xdocument.parse method. looks you're passing xml string uri load method wont work.


Comments