
June 15th, 2009, 01:33 PM
|
|
Contributing User
|
|
Join Date: Apr 2009
Posts: 2
Time spent in forums: 9 m 52 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by FranckGz Sorta pursuant to the above, can somebody show me how to open up an HTTP connection in my Silverlight code? And can I connect to just any server or does it have to be the one supplying the silverlight control?
I've had enormous, hand-wringing problems using Flash for XD - to the point where if someone says 'widget' I now say 'JSON,' but it's not progressive. (grin) |
Hi! The easiest way to do HTTP in Silverlight is with the WebClient class, like so:
WebClient client = new WebClient();
client.DownloadStringCompleted += client_DownloadStringCompleted;
client.DownloadStringAsync(urlname);
The only catch is that Silverlight has security limitations and can download only from the site containing the control, as well as a few sites out there that somebody at Microsoft has deemed safe.
|