赞
踩
封装一个类CSftp
upload_sftp.h
#define UPLOAD_SFTP_H
#include <QString>
#include <string>
#include "libssh2_sftp.h"
class CSftp#endif // UPLOAD_SFTP_H
upload_sftp.cpp
#include "upload_huainan.h"
#include <string>
#include "log.h"
#ifdef WIN32
#include <windows.h>
#include <winsock2.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#endif
CSftp::CSftp()
{
m_session = NULL;
m_sock = -1;
m_sftpSession = NULL;
m_sftpHandle = NULL;
}
CSftp::~CSftp()
{
if (m_session != NULL)
{
libssh2_session_free(m_session);
m_session = NULL;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。