Bonjour à tous
J'ai dans mon code une méthode qui s'appelle GetHTTP qui charge une URL (flux RSS). Le problème est que cette méthode s"exécute au même temps que la méthode d'authentification et si la méthode du flux RSS plante alors la connexion au site plante aussi et donc je voudrai faire un appel ASYNCHRONE a la methode GetHTTP
voila ma méthode :
Code : 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 public static string GetHTTP(string url) { try { if (!ConfigurationService.Instance.IsInternetActive()) return string.Empty; CustomWebClient c = new CustomWebClient(ConfigurationService.Instance.Session); c.Encoding = Encoding.UTF8; string data = c.DownloadString(url); c.Dispose(); return data; } catch (Exception e) { PopupNotificationViewModel.ShowPopup(PopupContentType.Erreur, "Impossible de récupérer les données."); Five.FiveControls.SendMailExcpetion.SendCatchExcpetion(e, url); return string.Empty; } }
Merci a vous
Partager