FTPSend.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // FTPSend.h: interface for the CFTPSend class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_FTPSend_H__05003AE0_E234_11D2_970B_00A024EBF6AB__INCLUDED_)
  5. #define AFX_FTPSend_H__05003AE0_E234_11D2_970B_00A024EBF6AB__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. class CFTPSend
  10. {
  11. // CAsyncSocket datachannel;
  12. BOOL m_pasved;
  13. public:
  14. int *m_bStop;
  15. CString m_path;
  16. CString m_ziptype;
  17. int m_pos;
  18. CString m_retmsg;
  19. //传输文件
  20. int MoveFile(CString remotefile, CString localfile, BOOL blast);
  21. //退出
  22. void LogOffServer();
  23. //登陆
  24. BOOL LogOnToServer(CString hostname,int hostport,CString username, CString password);
  25. CFTPSend();
  26. ~CFTPSend();
  27. //发送FTP命令
  28. BOOL FTPcommand(CString command);
  29. //读取响应
  30. BOOL ReadStr();
  31. //发送命令
  32. BOOL WriteStr(CString outputstring);
  33. private:
  34. //用于读写Socket数据
  35. CArchive* m_pCtrlRxarch;
  36. CArchive* m_pCtrlTxarch;
  37. CSocketFile* m_pCtrlsokfile;
  38. //控制连接Socket
  39. CSocket* m_Ctrlsok;
  40. int m_fc;
  41. BOOL ReadStr2();
  42. //打开控制连接
  43. BOOL OpenControlChannel(CString serverhost,int serverport);
  44. //关闭控制连接
  45. void CloseControlChannel();
  46. };
  47. #endif // !defined(AFX_FTPSend_H__05003AE0_E234_11D2_970B_00A024EBF6AB__INCLUDED_)