Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A guy walks into a bar
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01569430
Message ID:
01569502
Vues:
68
I have doubts whether FtpOpenFile function should be used at all.

Below is the link to a working code sample. The InternetReadFile API function is called in cycle each time reading a small portion of the remote file. Which makes a progress routine possible.

Using InternetSetFilePointer when resuming interrupted download from the Internet
http://www.news2news.com/vfp/?example=191

API functions used:
CloseHandle
CreateFile
GetFileSize
InternetCloseHandle
InternetOpen
InternetOpenUrl
InternetReadFile
InternetSetFilePointer
OpenFile
SetFilePointer
WriteFile
pcRemotePath = "http://www.php.net/distributions/manual/"
pcFilename = "php_manual_es.chm"
...
phRemote = InternetOpenUrl (hInternet, pcRemotePath + pcFilename,;
            "", 0, INTERNET_FLAG_NEED_FILE, 0)
...
IF InternetReadFile (phRemote, @lcBuffer,;
                    TransferBuffer, @lnBytesRead) <> 0
...
ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform