[英]Bug with webclient wp7
我正在使用WebClient對象來輪詢服務器中的某些數據。 當執行DownloadStringCompleted時,我將進行錯誤檢查:e.error,其中“ e”是DownloadStringCompletedEventArgs,如果發生錯誤,則輸出消息。 一切正常,但是當我使用運行中的3G在PHONE上運行應用程序時,出現錯誤“遠程服務器響應:未找到”。 但是,如果我打開WiFi,則一切正常。 在帶有該URL的瀏覽器頁面中打開,並在模擬器上,一切正常。 也許這是有史以來最愚蠢的問題,但我真的不明白發生了什么事:D
我該怎么解決?
PS對不起,我的英語。 必應翻譯幫助我=)
問題解決了。 它幫助了我
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(clientED2_DownloadStringCompleted);
webClient.DownloadStringAsync(new Uri("http://www.server.com"), "GET");
相反,這
WebClient webClient = new WebClient();
webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(clientED2_DownloadStringCompleted);
webClient.DownloadStringAsync(new Uri("http://www.server.com"));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.