try
{
WebClient client = new WebClient();
client.Encoding = Encoding.UTF8;
client.DownloadStringCompleted += client_DownloadStringCompleted;
Uri uri = new Uri(“txtUrl”, UriKind.Absolute);
client.DownloadStringAsync(uri);
msg.Text = “等待服务器响应”;
}
catch (Exception exp) { msg.Text = exp.Message; }
void client_DownloadStringCompleted (object sender,DownloadStringCompletedEventArgs e)
{
msg.Text=e.Result;
}
请叙述程序的运行过程和结果
点点赞赏,手留余香
给TA打赏
评论0