Bonjour a toutes et tous
Voila j'ai un probl�me pour r�cup�rer l'�tat d'avancement d'un t�l�chargement en c++/cli.
J'ai trouver dans la msdn ce bout de code pour r�cup�rer par �v�nment l'etat d'avancement du telechargement seulemen c'est en C# et je n'arrive pas a l'adapter en c++/cli.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 // Sample call : DownLoadFileInBackground2 ("http://www.contoso.com/logs/January.txt"); public static void DownLoadFileInBackground2 (string address) { WebClient client = new WebClient (); Uri uri = new Uri(address); // Specify that the DownloadFileCallback method gets called // when the download completes. client.DownloadFileCompleted += new AsyncCompletedEventHandler (DownloadFileCallback2); // Specify a progress notification handler. client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressCallback); client.DownloadFileAsync (uri, "serverdata.txt"); }
Voila mon code en c++/cli:
J'appelle les m�thodes ProgresBarCompleted et ProgressBar qui ce charge de faire varier l'�tat de la progressBarre.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2 objclient->DownloadFileCompleted += gcnew System::ComponentModel::AsyncCompletedEventHandler(ProgressBarCompleted); objclient->DownloadProgressChanged += gcnew System::Net::DownloadProgressChangedEventHandler(ProgressBar);
Le probl�me c'est que sa ne compile pas
Merci d'avance pour ceux qui ce donneront la peine de m'aider encore un fois.
Partager