0
嗯,我想立即下載從myurl/test.txt的數據我覺得該怎麼做,但下面的代碼:下載文件的Windows Mobile 6.x的
String forecastAdress = "myurl/test.txt";
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(forecastAdress);
//httpRequest.Credentials = CredentialCache.DefaultCredentials;
httpRequest.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
System.IO.Stream dataStream = httpResponse.GetResponseStream();
System.IO.StreamReader streamReader = new System.IO.StreamReader(dataStream);
String forecastData = streamReader.ReadToEnd();
listBox1.Text = forecastData;
textBox1.Text = forecastData;
streamReader.Close();
httpResponse.Close();
但在
System.IO.Stream dataStream = httpResponse.GetResponseStream();
occures錯誤
無法建立與網絡的連接。
我不知道它是連接失敗或什麼是錯我的代碼
沒有ti看起來像這樣http://myserver/odbierajka/wiadomosc.txt設備有一些連接因爲我可以瀏覽網站 – radek
好的,但你真的可以從設備上的Internet Explorer查看文本文件嗎? – Olipro
當我嘗試連接時丟失了,我不能冒用任何其他網站 – radek