Windows Phone 7 download pure HTML as a string?

I am trying to get a clear answer on how to load an HTML page as a string in a few months, but have made zero progress. I can mess around with all the parsing, and I can figure out where it should fit into the application when I communicate with it. I would be very grateful if someone could give me a clear block of code to load an HTML page as a string from a given URL.

+3
source share
3 answers

Well, the easiest way is to use WebClient:

WebClient client = new WebClient();
client.DownloadStringCompleted += YourEventHandler;
client.DownloadStringAsync(uri);

where the event handler performs all the necessary actions.

, WebClient ( "async" ) - , , , WebRequest, ( Stream WebResponse, StreamReader, ).

+2

System.Net.HttpWebRequest.Create(URL);

docs

+1
0

Source: https://habr.com/ru/post/1787207/


All Articles