ftp协议客户端和服务器源代码,FTP客户端和服务器源代码(C语言)实现

课程设计:FTP的设计与实现

/****************client.c****************/

#include

#include

#include

#pragma comment(lib,"ws2_32.lib")

#define DEFAULT_PORT 2302

#define DEFAULT_BUFFER 2048

#define DEFAULT_MESSAGE "This is a test of the emergency \ broadcasting system" char szServerip[128], // Server to connect to

szMessage[1024]; // Message to send to sever

int iPort = DEFAULT_PORT; // Port on server to connect to

//DWORD dwCount = DEFAULT_COUNT; // Number of times to send message BOOL bSendOnly = FALSE; // Send data only; don't receive

int dirfun();

int getfun();

int putfun();

int pwdfun();

int cdfun();

int mdfun();

int delfun();

int usafun();

void usage()

{

printf("usage: client [-p:x] [-s:IP] [-n:x] [-o]\n\n");

printf(" -p:x Remote port to send to\n");

printf(" -s:IP Server's IP address or hostname\n");

printf(" -n:x Number of times to send message\n");

printf(" -o Send messages only; don't receive\n");

ExitProcess(1);

}

void ValidateArgs(int argc, char **argv)

{

int i;

for(i = 1; i < argc; i++)

{

if ((argv[i][0] == '-') || (argv[i][0] == '/'))

{

switch (tolower(argv[i][1]))

{

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值