没有合适的资源?快使用搜索试试~ 我知道了~
基于主动模式的ftp客户端
4星 · 超过85%的资源 需积分: 26 24 下载量 91 浏览量
2014-06-06
18:18:33
上传
评论 1
收藏 37KB TXT 举报
温馨提示
试读
44页
基于主动模式的ftp客户端程序,在linux下运行
资源推荐
资源详情
资源评论
#include<stdio.h>
#include<sys/socket.h>
#include<stdlib.h>
#include<string.h>
#include<strings.h>
#include<unistd.h>
#include<netinet/in.h>
#include<netdb.h>
#include<errno.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#define SERV_PORT 21
#define MAXSIZE 1024
#define SA struct sockaddr
static int control_sockfd;
int npsupport;
int login_yes;
int f;//f=0时为默认文件结构
int login();
void ftp_list(int control_sockfd);
void zeromery(char *a,int len);
void ftp_pwd(int control_sockfd);
void ftp_changdir(char dir[],int control_sockfd);
void ftp_quit(int control_sockfd);
void ftp_creat_mkd(char *path,int control_sockfd);
void ftp_back(int control_sockfd);
void ftp_stru(int control_sockfd);
void ftp_rest(int control_sockfd);
int ftp_download(int control_sockfd);
#include<sys/socket.h>
#include<stdlib.h>
#include<string.h>
#include<strings.h>
#include<unistd.h>
#include<netinet/in.h>
#include<netdb.h>
#include<errno.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#define SERV_PORT 21
#define MAXSIZE 1024
#define SA struct sockaddr
static int control_sockfd;
int npsupport;
int login_yes;
int f;//f=0时为默认文件结构
int login();
void ftp_list(int control_sockfd);
void zeromery(char *a,int len);
void ftp_pwd(int control_sockfd);
void ftp_changdir(char dir[],int control_sockfd);
void ftp_quit(int control_sockfd);
void ftp_creat_mkd(char *path,int control_sockfd);
void ftp_back(int control_sockfd);
void ftp_stru(int control_sockfd);
void ftp_rest(int control_sockfd);
int ftp_download(int control_sockfd);
char *itoa(int value, char *string, int radix);
int main(int argc,char **argv)
{
printf("ftp>");
char command[MAXSIZE];
char*cmd;
scanf("%s",command);
cmd=command;
while(*(cmd)==' ')
cmd++;
if(strncmp(cmd,"login",5)==0)
{
login();
if(login_yes==1)
{
while(1)
{
comm:
sleep(1);
printf("ftp>");
zeromery(command,1024);
scanf("%s",command);
cmd=command;
while(*(cmd)==' ')
cmd++;
if(strncmp(cmd,"pasv",4)==0)
{
ftp_list(control_sockfd);
}
int main(int argc,char **argv)
{
printf("ftp>");
char command[MAXSIZE];
char*cmd;
scanf("%s",command);
cmd=command;
while(*(cmd)==' ')
cmd++;
if(strncmp(cmd,"login",5)==0)
{
login();
if(login_yes==1)
{
while(1)
{
comm:
sleep(1);
printf("ftp>");
zeromery(command,1024);
scanf("%s",command);
cmd=command;
while(*(cmd)==' ')
cmd++;
if(strncmp(cmd,"pasv",4)==0)
{
ftp_list(control_sockfd);
}
剩余43页未读,继续阅读
资源评论
- haicai19892019-12-27主动模式,运行直接死机!!!!!
- 小花园2021-01-24我运行倒是不会死机,有参考价值。但实际使用,还是直接用FluentFTP好
haibo8023
- 粉丝: 24
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于OpenCV的案例:图像边缘、角点和轮廓检测,图像分割,图像增强;图片拼接;运动目标检测,颜色直方图比较,三帧帧差法,抠图
- SmartPlug-html大一笔记
- SmartPlug-proteusdemo
- Preliminary Findings on Handmade Rattan Baby Crib andBassinet Designs Regarding.zip
- aveebfq_v1.2.83_downyi.com.apk
- 基于有机发光二极管(OLED)的建模优化算法的matlab仿真源码+数据+文档说明+项目说明(高分课程设计)
- hash01-test.c 本人哈希表(一)的示例代码,仅供参考!
- 处理数据.py
- 软件实施计划表.xls
- 软件开发应用软件项目提交文档目录要求(全过程)(推荐文档).xls
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功