Developing an FTP client with the WinInet Api (ii)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.