Accessing Webpages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

How can I download a webpage into a String? It's actually an online xml doc that I want to store in a DataSet, any ideas

Jennifer.
 
webpages are returned as the results of a get, post or put request. So you
need to make a request to get the server to return the results of your call.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemnetwebrequestclasstopic.asp

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP


Jennifer said:
Hi,

How can I download a webpage into a String? It's actually an online xml
doc that I want to store in a DataSet, any ideas?
 
Use System.Net.WebClient to read the data

Code should look somewhat like ...

WebClient myWebClient = new WebClient();
Stream myStream = myWebClient.OpenRead(uriString);
DataSet ds = new DataSet();
ds.ReadXml(myStream);

Cheers
Nirmal
 
Back
Top