📄 test.c
字号:
#include <stdio.h>
#include "SimpleFTP.h"
int main(int argc, char *argv[])
{
int i = -2;
SimpleFTP *ftp;
char * path = 0;
i = SimpleFTP_init(&ftp);
if( i == -1)
{
printf("allocate memery error!");
return -1;
}
i = ftpConnect(ftp ,"root","123456" ,"192.168.1.155" , 21);
if( i)
{
printf("last reply :%s\n",getLastReply(ftp));
}else{
printf("connect or login failed!\n");
SimpleFTP_free(ftp);
return 0;
}
i = -2;
ascii(ftp);
bin(ftp);
cwd(ftp ,"/tftpboot");
path = pwd(ftp);
printf("current path is :%s \n",path);
free(path);
get(ftp ,"./newld","ld");
i = stor(ftp ,"./test.c");
if( i )
{
printf("stor ok \n");
}else{
printf("stor failed !\n");
}
printf("last reply :%s\n", getLastReply(ftp));
ftpDisconnect(ftp);
SimpleFTP_free(ftp);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -