在windows phone 8.1 中可以用 HttpClient 类来发送http 请求。

例子:

try
{
Uri uri = new Uri(@"http://api.map.baidu.com/geocoder/v2/?ak=me7OnuVB5X281MDULQntOswb&location=39.983424,116.322987");
HttpClient client = new HttpClient();
string s = await client.GetStringAsync(uri); // 这里用到了awit 。
tbk_A.Text = s;
}
catch(Exception ex)
{
tbk_A.Text = ex.ToString(); // 当网络出现异常时会进入这里。
}

相关文章:

  • 2021-12-05
  • 2021-08-11
  • 2022-12-23
  • 2021-08-09
  • 2021-09-30
  • 2021-10-01
  • 2021-10-03
  • 2021-10-03
猜你喜欢
  • 2021-04-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
相关资源
相似解决方案