Hi all,
I'm having this problem, the following code is used to request a page
where I want to be able to read the response, which is an xml page:
string sUrl = "http://www.thirdpartysendingsms.com";
HttpWebRequest myRequest =(HttpWebRequest)WebRequest.Create(sUrl);
WebResponse myResponse = myRequest.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream());
string sResponse = sr.ReadToEnd();
sResponse contains: bostaddirekt97579
While the whole page I've requested looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
- <response code="0" description="Message processed">
<error code="3" description="Could not find any matching prefix for
+99999">bostaddirekt97579</error>
</response>
Now what I want is to be able to extract the error code, in Java I see
them using something like:
URL myUrl = new URL(sUrl);
HttpURLConnection myConn = (HttpURLConnection) myUrl.openConnection();
InputStream in = myConn.getInputStream();
Document myResponse = documentBuilder.parse(in);
Element root = myResponse.getDocumentElement();
And then from there one works with the root to find a specific node, is
there anything equivalent in c#?
Thanks for any pointers!