Question

En ce moment, je travaille avec mon premier projet Windows Mobile et j'ai un problème bizarre ..
J'utilise WebRequest de télécharger des images à partir d'Internet -. Sur mon portable il fonctionne, mais Débogueur je exceptions socket

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);

Sortie:

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).

Comment forcer mon instance locale pour obtenir ces images?

Était-ce utile?

La solution

Si vous utilisez l'émulateur de périphérique, il suffit de configurer les informations réseau.

Et assurez-vous qu'il peut se connecter avec le monde extérieur (qui pourrait ne pas être possible en fonction de votre infrastructure réseau).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top