LoadRunner开发ftp协议接口之上传文件脚本
Action() { //建立一个ftp对象 FTP myftp=0; //建立FTP连接并登录 ftp_logon_ex(&myftp,"ftpLogon", "URL=ftp://192.168.11.12", LAST); //插入集合点和事务 lr_rendezvous("一起上传文件"); lr_start_transaction("文件上传"); //上传文件 ftp_put_ex(&myftp,"fupPutFile", "SOURCE_PATH=c:\\{filenames}", "TARGET_PATH=/files/{filenames}",ENDITEM, LAST); lr_end_transaction("文件上传", LR_AUTO); //释放FTP连接 ftp_logout_ex(&myftp); return 0; }