用ftp_get_last_download_details得到下载明细
Action()
{
double duration; //定义持续时间变量
unsigned long ZSize, ZDur; //定义两个无符号长整型变量
char * host = "192.168.16.28"; //给IP地址赋值
char * user = "test"; // 给用户名赋值
char * pwd = "test"; //给密码
char * port = "21"; //给端口赋值
char ftpURL[100]; //定义一个URL数组
sprintf(ftpURL,"URL=ftp://%s:%s@%s:%s", user, pwd, host, port); //打印组合后的URL。并赋值给ftpURL数组
lr_output_message("%s",ftpURL); //打印ftpURL数组
/* 登录主机 */
ftp_logon("Zee",ftpURL, LAST); ///Zee是一个登录事务名
ftp_dir("Z1", "PATH=/", ENDITEM, LAST); //FTP的目录
ftp_get("Get_File",
"SOURCE_PATH=1.mdb",
"TARGET_PATH=f:/2/1.mdb",
"MODE=BINARY",
ENDITEM ,
LAST);
duration= ftp_get_last_transfer_duration(); //得到GET命令的传输时间
lr_output_message("Get_File Transfer took %.3f milliseconds", duration); //打印传输时间
ftp_get_last_download_details( &ZSize, &ZDur); //得到下载明细:字节数和下载时间
lr_output_message("Get_File Download of %d bytes took %d milliseconds", ZSize, ZDur);
duration = ftp_get_last_handshake_duration(); //得到握手持续时间
lr_output_message("Handshake took %f milliseconds", duration); //打印握手持续时间
ftp_logout();
return 0;
}