Skip to content

Instantly share code, notes, and snippets.

@tsubakimoto
Created March 27, 2014 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubakimoto/9801631 to your computer and use it in GitHub Desktop.
Save tsubakimoto/9801631 to your computer and use it in GitHub Desktop.
private void btnSync_Click(object sender_, RoutedEventArgs e_)
{
var client = new WebClient();
client.Encoding = Encoding.UTF8;
var json = client.DownloadString(this.txtUrl.Text);
this.txtJson.Text = json;
}
private void btnAsync_Click(object sender_, RoutedEventArgs e_)
{
var client = new WebClient();
client.Encoding = Encoding.UTF8;
client.DownloadStringCompleted += (sender, e) =>
{
this.txtJson.Text = e.Result;
};
client.DownloadStringAsync(new Uri(this.txtUrl.Text));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment