计网socket编程实验报告.doc深圳大学实验报告
实验课程名称: 计算机网络
实验项目名称: Socket 编程
学院: 计算机与软件学院 专业: 计算机科学与技术
include<fstream>
#include<iostream>
#include<>
#include<>
#include<string>
#include""
using namespace std;
#define MENU "Welcome To The FTP Server,Please Input The Command And Enter!Such as: LIST,CWD,RETR,STOR,DELE,RMD,MKD"
;
cout<<Dir<<endl;
client->sendCommand();
client->receiveCommand();
client->receiveList();
client->receiveCommand();
}
else if(strcmp(Command,"CWD")==0||strcmp(Command,"cwd")==0)
{
memset(Dir,NULL,512);
cout<<"Plase input the dir of your will(compelete
dir)::"<<endl;
cin>>Dir;
client->setCommand("CWD ",Dir);
client->sendCommand();
client->receiveCommand();
}
else if(strcmp(Command,"retr")==0||strcmp(Command,"RETR")==0)
{
char* filename = new char[512];
memset(filename,NULL,512);
/************************************
下载模块
************************************/
client->setCommand("PASV");
client->sendCommand();
client->receiveCommand();
client->getPort();
client->setCommand("TYPE","I");
client->sendCommand();
client->receiveCommand();
client->interlizeDataSocket();
cout<<"Please input the name you want to download:";
cin>>filename;
client->setCommand("RETR ",filename);
client->sendCommand();
client->
计网socket编程实验报告 来自淘豆网m.daumloan.com转载请标明出处.