📄 zhuftp.h
字号:
#ifndef ZHUFTP_H_#define ZHUFTP_H_#include <stdio.h>#include <sys/socket.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>#include <string.h>#include <stdlib.h>#include <time.h>#define FTP_DISCONNECTED 0#define FTP_CONECTED 1#define FTP_TRANSING 2#define FTP_STOPPING 3typedef struct { char prior[12]; int usern; char username[32]; char groupname[32]; int filesize; char date[4]; int day; char time[8]; char filename[40];}ftpfiledis;class FtpZhu{ struct sockaddr_in cmdaddr; int FtpStatus;//0,disconnected,1,connected,2,downloading int CmdSocket; int Timeout; time_t lasttime; char recvbuffer[512]; int SendFtpCommand(int sockfd,const char*cmd); int CheckTime(int flag,int interval);public: FtpZhu(); ~FtpZhu(); int ConnectServer(const char *ServerIp,const char*uname,const char*password); int GetFile(const char *remotepath,const char *localpath,const char *filename); int PutFile(const char *remotepath,const char *localpath,const char* filename); int CheckTime(int flag); void SetTimeout(int interval); int Disconnect(); int GetFtpStatus();};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -