Information générale
Catégorie:
Applications Internet
Titre:
Some constants literal value
Hello:
I'm trying to download a file programaticaly, from a FTP server, and i'm using the following code (resumed):
DECLARE INTEGER InternetCloseHandle ;
IN WinInet.DLL ;
INTEGER
DECLARE INTEGER InternetOpen ;
IN WININET.DLL ;
STRING,;
INTEGER,;
STRING, STRING, INTEGER
DECLARE INTEGER InternetConnect ;
IN WININET.DLL ;
INTEGER IPHandle,;
STRING Server,;
INTEGER Port, ;
STRING UserName,;
STRING Password,;
INTEGER ServiceFlags,;
INTEGER Reserved,;
INTEGER Reserved
DECLARE Integer FtpGetFile ;
IN WinInet.dll ;
Integer IPSession,;
String Source,;
String Target, ;
Integer NoOverwrite,;
INTEGER Attributes, ;
Integer Flags, ;
Integer Context
* Here begins my problem
* I don't know what should be the value for dwAccessType:
* it should be one of the following:
* INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PRECONFIG, ...,
* INTERNET_OPEN_TYPE_PROXY
* but these are constant values that i've not defined anywhere,
* if i search MSDN, they say that dwAccessType should be:
* INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PRECONFIG, ...,
* or INTERNET_OPEN_TYPE_PROXY
* what a help, anyone know's what is the value of these constants?
hInetConnection = InternetOpen("Microsoft® Internet Explorer",;
dwAccessType,;
NULL,NULL,0)
* Here, other problem, the constant: INTERNET_PORT.
* Once again MSDN was so helpful. It says that INTERNET_PORT
* should have one of the following values INTERNET_DEFAULT_FTP_PORT,
* INTERNET_...,
* but what are the possible literal values?
lhFTPSession = InternetConnect(hInetConnection,;
lcServer,;
lnHTTPPort,;
lcUsername,;
lcPassword,;
INTERNET_PORT,;
m.nServiceFlags,0)
lnResult = FtpGetFile(m.hFTPSession,lcSource,;
lcTarget,0,FILE_ATTRIBUTE_NORMAL,;
lnBinary + INTERNET_FLAG_RELOAD,0)
Because i don't know the value of none of these constants, i go on tries. And, of course this code don't work. Anyone can help me?
Thank you in advance.
Joaquim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement