質問


..私は私の最初のWindows Mobileプロジェクトで働いていると私は奇妙な問題を抱えています 私は、インターネットからいくつかの画像をダウンロードするWebRequestを使用しています - 。私の携帯電話上では動作しますが、デバッガで、私は、ソケットの例外を持っている。

string url    = "http://new.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate=2010011006&row=381&col=199&lang=pl";
Stream stream = null;
WebRequest requestPic   = WebRequest.Create(url);
WebResponse responsePic = requestPic.GetResponse();
stream = responsePic.GetResponseStream();

return new System.Drawing.Bitmap(stream);

出力:

A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
The thread 0x167c46f6 has exited with code 0 (0x0).

この画像を得るために、私の地元のインスタンスを強制するには?

役に立ちましたか?

解決

あなたは、デバイスエミュレータを使用している場合は、

、単にネットワーク情報を設定します。

そして、それは(あなたのネットワークインフラストラクチャに依存できない可能性がありますどの)外の世界に接続できることを確認します。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top