I want to get source code of some website.
I found this solution:
var html = System.Net.WebClient().DownloadString(siteUrl);
But Vi
WebClient does exist in WP8 like this:
WebClient thisclient = new WebClient();
thisclent.DownloadStringAsync(new Uri("urihere");
thisclient.DownloadStringCompleted += (s, x) =>
{
if (x.Error != null)
{
//Catch any errors
}
//Run Code
}
For 8.1 apps, use something like this:
HttpClient http = new System.Net.Http.HttpClient();
HttpResponseMessage response = await http.GetAsync("somesite");
webresponse = await response.Content.ReadAsStringAsync();