-
大小: 3KB文件類(lèi)型: .rar金幣: 1下載: 0 次發(fā)布日期: 2021-01-07
- 標(biāo)簽: FTP??
資源簡(jiǎn)介
C語(yǔ)言實(shí)現(xiàn)FTP上傳文件(支持windows和linux和ARM的交叉編譯環(huán)境)
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include??
#include?
#include?
#include?
#define?MAX_LEN?1024*1
#define?MAX_CMD_LEN?128
static?inline?int?ftp_socket_send(int?fd?char?*str)
{
send(fd?str?strlen(str)?0);
return?0;
}
static?inline?int?ftp_socket_recv(int?fd?char?*str)
{
int?size;
size?=?recv(fd?str?MAX_LEN-1?0);
str[size]?=?0;
printf(“ftp?recv:?%s\n“str);
return?0;
}
static?int?ftp_get_data_port(char?*buff?in_port_t?*port)
{
int?i?=?0?j?=?0;
short?port_l?=?0?port_h?=?0;
????if?(buff?==?NULL?||?port?==?NULL)
????{
????????return?-1;
????}
????//?(192168186140).
while?(buff[i++]?!=?‘(‘);
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????194??2018-05-03?22:04??FTP上傳文件代碼0123456\CommunctionConfig.ini
?????文件???????4451??2018-05-03?14:31??FTP上傳文件代碼0123456\ftp_upload.c
?????文件???????4879??2018-05-03?14:32??FTP上傳文件代碼0123456\main.c
?????目錄??????????0??2018-05-03?14:32??FTP上傳文件代碼0123456\img
?????目錄??????????0??2018-05-03?22:05??FTP上傳文件代碼0123456
-----------?---------??----------?-----??----
?????????????????9524????????????????????5
評(píng)論
共有 條評(píng)論