bcb6.0调用API和VC一样
#include <vcl.h>
#pragma hdrstop
#include <Wininet.h>
#program comment(lib,"Wininet.lib")
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc, char* argv[])
{
HINTERNET m_hConnect;
HINTERNET m_hSession;
m_hSession = InternetOpen("admin",INTERNET_OPEN_TYPE_DIRECT,"","",NULL);
m_hConnect = InternetConnect(m_hSession,"127.0.0.1",21,"userid","pass",INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE ,0);
FtpCreateDirectory(m_hConnect,"NewFolder") ;
FtpSetCurrentDirectory(m_hConnect,NewFolder) ;
FtpPutFile(m_hConnect,"c:\\test.txt","NewName.txt",FTP_TRANSFER_TYPE_BINARY ,0) ;
FtpGetFile(m_hConnect,"NewName.txt","C:\\DownLoad.txt",FALSE,
FILE_ATTRIBUTE_NORMAL,INTERNET_FLAG_RELOAD,0) ;
FtpDeleteFile(m_hConnect,"NewName.txt") ;
InternetCloseHandle(m_hConnect);
InternetCloseHandle(m_hSession);
return 0;
}