public async Task GetSomeInformationAsync(string url, OnGetSomeInformationCompleted onGetSomeInformationCompleted) { string result = ""; using (var client = new HttpClient()) { HttpResponseMessage response = await client.GetAsync(url); if (response.IsSuccessStatusCode) { result = await response.Content.ReadAsStringAsync(); } } onGetSomeInformationCompleted(result); }
public void GetSomeInformation(string url, OnGetSomeInformationCompleted onGetSomeInformationCompleted) { }
public void GetSomeInformation(string url, OnGetSomeInformationCompleted onGetSomeInformationCompleted) { System.Threading.Tasks.Task.Run( () => GetSomeInformationAsync(url, onGetSomeInformationCompleted)); }