Bonjour,
Je suis entrain de faire ma première application silverlight avec l'aide du tutoriel de benjamin roux. J'arrive bien à récupérer les donner depuis l'API flickr mais quand j'essaie de récupérer de donnée ailleurs j'obtiens une erreur : "Download Failure".
L'url que je cherche à atteindre : http://publish.anakrya.com/status.xml
Mon Code :
Code C# : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 private void LoadData() { string url = "http://publish.anakrya.com/status.xml"; WebClient webClient = new WebClient(); webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted); webClient.DownloadStringAsync(new Uri(url)); } void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { HtmlPage.Window.Alert("bouh!"); if (e.Error == null) { resultBlock.Text = e.Result; } else { resultBlock.Text = e.Error.Data.ToString(); } }
Ai-je raté quelque chose?
Partager