ftp服务器c语言,FTP服务器源代码C语言

FTP服务器端源代码:

// Mini FtpServer.cpp : Defines the entry point for the console application.

#include "stdafx.h"

#include

#include

#include

#pragma comment(lib,”ws2_32.lib”);

#define WSA_RECV 0

#define WSA_SEND 1

#define DATA_BUFSIZE 8192

#define MAX_NAME_LEN 128

#define MAX_PWD_LEN 128

#define MAX_RESP_LEN 1024

#define MAX_REQ_LEN 256

#define MAX_ADDR_LEN 80

#define FTP_PORT 21 // FTP 控制端口

#define DATA_FTP_PORT 20 // FTP 数据端口

#define USER_OK 331

#define LOGGED_IN 230

#define LOGIN_FAILED 530

#define CMD_OK 200

#define OPENING_AMODE 150

#define TRANS_COMPLETE 226

#define CANNOT_FIND 550

#define FTP_QUIT 221

#define CURR_DIR 257

#define DIR_CHANGED 250

#define OS_TYPE 215

#define REPLY_MARKER 504

#define PASSIVE_MODE 227

#define FTP_USER "toldo"

#define FTP_PASS "toldo"

#define DEFAULT_HOME_DIR "C:\\TEMP"

#define MAX_FILE_NUM 1024

#define MODE_PORT 0

#define MODE_PASV 1

#define PORT_BIND 1821

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值