91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.05MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-09-27
  • 語言: 其他
  • 標(biāo)簽: linux??ftp??client??C語言??

資源簡介

互聯(lián)網(wǎng)應(yīng)用課程的大作業(yè),rar壓縮包無密碼,解壓后的資源包括:源代碼+pdf的報告,其中源代碼為一個程序,pdf報告中包含程序教程、截圖、及設(shè)計流程圖。

資源截圖

代碼片段和文件信息

/*?header?files?*/
//????μ?÷get?put?£¨“?≤?√???∫√?à‘??“’?—??‘??∫?…′£¨mayan≤a––?6.3?20:00
#include
#include????
#include????
#include
#include /*?getservbyname()?gethostbyname()?*/
#include /*?for?definition?of?errno?*/
#include??????/*?for??inet_aton()*/??????//?...................
#include??????/*?for??inet_aton()*/??????//?...................
#include??????/*?for??inet_aton()*/??????//?...................
#include????
#include????????/*?for?write?open?read?*/
#include?????????/*?for?read?write?open?*/
#include????
#include????????/*for?mask?password*/

#define?BACKLOG?10?/*??ó¥??¨?±?¨Ω”???????*/
/*?define?macros*/
#define?MAXBUF 1024
#define?STDIN_FILENO 0
#define?STDOUT_FILENO 1

#define?ECHOFLAGS?(ECHO?|?ECHOE?|?ECHOK?|?ECHONL)??//?/*for?mask?password*/
/*?define?FTP?reply?code?*/
#define?USERNAME 220
#define?PASSWORD 331
#define?LOGIN 230
#define?PATHNAME 257
#define?CLOSEDATA 226
#define?ACTIONOK 250

/*?DefinE?global?variables?*/
char *host; /*?hostname?or?dotted-decimal?string?*/
char *port;
char *rbuf?*rbuf1; /*?pointer?that?is?malloc‘ed?*/
char *wbuf?*wbuf1; /*?pointer?that?is?malloc‘ed?*/
struct?sockaddr_in servaddr;
struct?hostent?*hptr;
struct?in_addr?temporary_IP;
int?totalfilesize;
int?upfilesize;
struct?timeval?startstartup;
struct?timeval?endendup;
long?timeusedtimeusedup;
int?retransmit=0;
char?*thesize;
char?*limitspeed;

int?fileno(FILE?*stream);
int?fstat(int?filedesstruct?stat?*buf);
struct?stat?thefilestruct;
struct?stat?upfilestruct;
int cliopen(char?*host?char?*port);???/*?function?list?*/
void strtosrv(char?*str?char?*host?char?*port);
void cmd_tcp(int?sockfd);
void ftp_list(int?sockfd);
int ftp_get(int?sck?char?*pDownloadFileName_s);
int ftp_put?(int?sck?char?*pUploadFileName_s);
int?????flag_150=0;?//?to?distinguish?“l(fā)s“?and?“?get?[filename]“??instuction
int
main(int?argc?char?*argv[])
{
????int fd;
????//code?here:?Allocate?the?read?and?write?buffers?before?open().
????char?write_buffer[MAXBUF];??//?send?to?server
????char?read_buffer[MAXBUF];???//?get?from?server
????
if?(0?!=?argc-2)
{
printf(“%s\n““missing?“);
exit(0);
}???//?end?of?if
????
host?=?argv[1];
port?=?“21“;
????
????rbuf=(char?*)malloc(MAXBUF);
????rbuf1=(char?*)malloc(MAXBUF);
????wbuf=(char?*)malloc(MAXBUF);
????wbuf1=(char?*)malloc(MAXBUF);
fd?=?cliopen(host?port);
????printf(“sockfd(the?first)?is?%d?\n“fd);
cmd_tcp(fd);
????
exit(0);
}??//?end?of?main?function


/*?Establish?a?TCP?connection?from?client?to?server?*/
int?cliopen(char?*host?char?*port)
{
????int?a;?//?host?is?IP?or?domain?name
????int?sockfd;//?returned?socket?number
????int?send_length;
????int?receive_length;
????char?str[32];
????unsigned?short?echoServPort;
????char?*servIP;
????
????//?host?is?IP?or?domain?name
????a=inet_aton(host&temporary_IP);
????printf(“flag?is?:?%d?(1?means?IP0

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件????1216362??2013-06-17?19:23??ftpclt_2010215102_10212784&10212772_梁揚&王可惟.pdf

?????文件??????30658??2013-06-12?12:56??ftpclt_2010215102_10212784&10212772_梁揚&王可惟.c

-----------?---------??----------?-----??----

??????????????1247020????????????????????2


評論

共有 條評論