Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Signs of progress
Message
De
24/03/2013 17:43:02
 
 
À
24/03/2013 16:50:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01569160
Message ID:
01569162
Vues:
94
>Hi All,
>
>I'd like display a progress bar when my app downloads files from my website. I'm using urldownloadtofile().
>How can I return: a) the file size, and; b) the number of bytes at any given point?
>Thanks.
>
>Luke

(1) you open internet with InternetOpen() api
(2) you open the file with InternetOpenUrl() api
(3) you use HttpQueryInfo() api - to get the filesize of the handle returned in (2)
(4) in a loop, you use InternetReadFile() api until no bytes have been read
You add the number of bytes read with InternetReadFile() api - that's the number to display in the progressbar

(5) you close the handle of (2) with InternetCloseHandle() api
(6) you close the handle of (1) with InternetCloseHandle() api

I think that's about it
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform