Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void GetSomeInformation(string url, OnGetSomeInformationCompleted onGetSomeInformationCompleted)
 {
 }
Esempio n. 3
0
 public void GetSomeInformation(string url, OnGetSomeInformationCompleted onGetSomeInformationCompleted)
 {
     System.Threading.Tasks.Task.Run(
         () => GetSomeInformationAsync(url, onGetSomeInformationCompleted));
 }