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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)