public DownloadDataInBackground ( int callId, Action returnResult ) : void | ||
callId | int | |
returnResult | Action | |
return | void |
public void DownloadDataInBackground(int callId, Action<int> returnResult)
{
WebClient client = new WebClient();
Uri uri = new Uri("https://www.google.com/search?q=" + callId.ToString());
client.DownloadStringCompleted += (s, e) =>
{
// Do something else with result ?
returnResult(e.Result.Length);
};
client.DownloadStringAsync(uri);
}
private void button1_Click(object sender, RoutedEventArgs e)