64,648
社区成员
发帖
与我相关
我的任务
分享
CString CFtpLoad::GetlastErrorInfo()
{
CString csErorr("");
LPVOID lpMsgBuf;
DWORD dwErrMsg = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER|
FORMAT_MESSAGE_FROM_SYSTEM|
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dwErrMsg,
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
(LPTSTR)&lpMsgBuf,
0,
NULL);
csErorr.Format("%s",lpMsgBuf) ;
return csErorr;
}
#include <afxinet.h>
#include <vector>
using namespace std;
//FTP Server 信息
struct FtpServerParam
{
CString m_csIp;
CString m_csUser;
CString m_csPwsd;
CString m_csFolder;
INTERNET_PORT m_Port;
CString m_csRemotePath;
};
class CFtpLoad
{
public:
CFtpLoad();
virtual~CFtpLoad();
CInternetSession *m_pInetSession;
CFtpConnection *m_pFtpConnection;
FtpServerParam m_ConnParam;
BOOL m_bConnected;
public:
void ParseRecvMsg(CString RecvMsg);
BOOL FtpConn();
BOOL FtpUpLoadExcute(CString csLocalFile,CString csRemoteFile);
BOOL FtpDownLoadExcute(CString csLocalFile,CString csRemoteFile);
CString GetlastErrorInfo();
};