xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 6KB
    文件類(lèi)型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-16
  • 語(yǔ)言: C/C++
  • 標(biāo)簽: FTP??上傳??下載??

資源簡(jiǎn)介

非常好用的FTP文件上傳和下載等管理類(lèi),可輕松移植到你的C++程序中,目前已經(jīng)應(yīng)用于我們項(xiàng)目中。這個(gè)類(lèi)適用于windows環(huán)境下

資源截圖

代碼片段和文件信息

/*******************************************************
Copyright?2014-2016??xhl?Co.?Ltd.?
文??件: FTPManager.cpp
開(kāi)發(fā)單位:
編??寫(xiě): XHL
日??期: 2015.04
描??述: FTP文件上傳下載管理文件
修??改:
********************************************************/

#include?“stdafx.h“
#include?“FTPManager.h“

static?int?SplitString(?std::string?strSrc?std::list?&strArray??std::string?strFlag)
{
int?pos?=?1;?

while((pos?=?(int)strSrc.find_first_of(strFlag.c_str()))?>?0)?
{
strArray.insert(strArray.end()?strSrc.substr(0??pos));
strSrc?=?strSrc.substr(pos?+?1?strSrc.length()?-?pos?-?1);?
}

strArray.insert(strArray.end()?strSrc.substr(0?strSrc.length()));

return?0;?
}

CFTPManager::CFTPManager(void):?m_bLogin(false)
{
m_cmdSocket?=?socket(AF_INET?SOCK_STREAM?0);
}

CFTPManager::~CFTPManager(void)
{
std::string?strCmdLine?=?parseCommand(FTP_COMMAND_QUIT?““);

Send(m_cmdSocket?strCmdLine.c_str());
closesocket(m_cmdSocket);
m_bLogin?=?false;
}

FTP_API?CFTPManager::login2Server(const?std::string?&serverIP)
{
std::string?strPort;
int?pos?=?serverIP.find_first_of(“:“);

if?(pos?>?0)
{
strPort?=?serverIP.substr(pos?+?1?serverIP.length()?-?pos);
}
else
{
pos?=?serverIP.length();
strPort?=?FTP_DEFAULT_PORT;
}

m_strServerIP?=?serverIP.substr(0?pos);
m_nServerPort?=?atol(strPort.c_str());

trace(“IP:?%s?port:?%d\n“?m_strServerIP.c_str()?m_nServerPort);

if?(Connect(m_cmdSocket?m_strServerIP?m_nServerPort)? {

return?-1;
}

m_strResponse?=?serverResponse(m_cmdSocket);
printf(“@@@@Response:?%s“?m_strResponse.c_str());

return parseResponse(m_strResponse);
}

FTP_API?CFTPManager::login2Server(const?std::string?&serverIPconst?std::string?&serverPor)
{
std::string?strPort;
int?pos?=?serverIP.find_first_of(“:“);

if?(pos?>?0)
{
strPort?=?serverIP.substr(pos?+?1?serverIP.length()?-?pos);
}
else
{
pos?=?serverIP.length();
strPort?=?serverPor;
}

m_strServerIP?=?serverIP.substr(0?pos);
m_nServerPort?=?atol(strPort.c_str());

trace(“IP:?%s?port:?%d\n“?m_strServerIP.c_str()?m_nServerPort);

if?(Connect(m_cmdSocket?m_strServerIP?m_nServerPort)? {

return?-1;
}

m_strResponse?=?serverResponse(m_cmdSocket);
printf(“@@@@Response:?%s“?m_strResponse.c_str());

return parseResponse(m_strResponse);
}

FTP_API?CFTPManager::inputUserName(const?std::string?&userName)
{
std::string?strCommandLine?=?parseCommand(FTP_COMMAND_USERNAME?userName);

m_strUserName?=?userName;

if?(Send(m_cmdSocket?strCommandLine)? {
return?-1;
}

m_strResponse?=?serverResponse(m_cmdSocket);
printf(“Response:?%s\n“?m_strResponse.c_str());

return?parseResponse(m_strResponse);
}

FTP_API?CFTPManager::inputPassWord(const?std::string?&password)
{
std::string?strCmdLine?=?parseCommand(FTP_COMMAND_PASSWORD?password);

m_strPassWord?=?password;
if?(Send(m_cmdSocket?strCmdLine)?

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件??????18272??2015-04-10?15:02??FTPManager.cpp

?????文件???????5583??2015-04-10?08:55??FTPManager.h

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

????????????????23855????????????????????2


評(píng)論

共有 條評(píng)論