FTP WINAPI function Detailed
The relationship between functions of FTP
Each FTP function needs to use the FTP session handle created by InternetConnect. The InternetConnect function needs to use the hinternet handle created by InternetOpen. The following diagram shows how they relate to each other.
And for some of the commands that operate online, their relationship can be expressed in the following diagram. For example, the two commands used to enumerate the files in the current directory Ftpfindfirstfile and Internetfindnextfile, internetfindnextfile a handle that needs to be returned by Ftpfindfirstfile.
WinInet function
|
Function
|
Description
|
|
Connection
|
|
InternetOpen
|
Initialize WinInet and return hinternet handles
|
|
InternetConnect
|
Set up an Internet connection to open an FTP, Gopher, or HTTP session. Back to Hinternet handles
|
|
InternetCloseHandle
|
Turn off Internet connections
|
|
Directory Operations
|
|
Ftpcreatedirectory
|
Creating a directory on an FTP server requires a InternetConnect returned session handle
|
|
Ftpremovedirectory
|
Deleting a directory on an FTP server requires a InternetConnect returned session handle
|
|
Ftpgetcurrentdirectory
|
Gets the working directory currently on the FTP server that requires the session handle returned by InternetConnect
|
|
Ftpsetcurrentdirectory
|
Set the working directory on the FTP server, requiring a internetconnect return session handle
|
|
File actions
|
|
Ftpfindfirstfile
|
To find a qualifying file or directory on an FTP server, you need to internetconnect the session handle returned
|
|
Internetfindnextfile
|
To continue to find the next eligible file or directory on the FTP server, you need to ftpfindfirstfile the session handle returned
|
|
FtpPutFile
|