大学MOOC Dot Net Web编程应用程序实践(深圳信息职业技术学院)1206302813 最新慕课完整章节测试答案
项目一 天气预报查询程序
测验1
1、单选题:
下面程序下载http://127.0.0.1的字符串: try { WebClient client = new WebClient(); client.Encoding = Encoding.UTF8; client.DownloadStringCompleted += client_DownloadStringCompleted; Uri uri = new Uri("http://127.0.0.1", UriKind.Absolute); client.DownloadStringAsync(uri); msg.Text = "OK"; } catch (Exception exp) { msg.Text = exp.Message; }在执行client.DownloadStringAsync(uri)后
选项:
A: 程序等待服务器响应,然后显示msg.Text = "OK";
B: 程序不等待服务器响应,就显示msg.Text = "OK";
C: 程序有错误,语句 client.DownloadStringCompleted += client_DownloadStringCompleted;应该为:client.DownloadStringCompleted = client_DownloadStringCompleted;
D: 以上都不对
答案: 【 程序不等待服务器响应,就显示msg.Text = "OK";】点我阅读全文
