ClientFtpDlg.h
资源名称:FTP总集.rar [点击查看]
上传用户:tjfeida
上传日期:2013-03-10
资源大小:1917k
文件大小:3k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // ClientFtpDlg.h : 头文件
- //
- #if !defined(AFX_FTPSOCKETDLG_H__E0B6E988_9D2B_4461_8694_DDAB5027F497__INCLUDED_)
- #define AFX_FTPSOCKETDLG_H__E0B6E988_9D2B_4461_8694_DDAB5027F497__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "afxcmn.h"
- #include "afxwin.h"
- #include "MyFtpClient.h"
- #include "MyFtpList.h"
- #define WM_SETFILE WM_USER +100
- #define WM_SETREDRAWFLAG WM_USER +101
- #define WM_SETDIRECTORYDISPLAY WM_USER +102
- #define WM_REDISPLAYFILE WM_USER +103
- #define WM_SETDIR WM_USER +104
- //定义枚举文件量
- enum
- {
- FILEICON,
- DIRECTORYICON,
- LOCFILE,
- SERVFILE
- };
- // CClientFtpDlg 对话框
- class CClientFtpDlg : public CDialog
- {
- // 构造
- public:
- CClientFtpDlg(CWnd* pParent = NULL); // 标准构造函数
- // 对话框数据
- enum { IDD = IDD_CLIENTFTP_DIALOG };
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
- // 实现
- protected:
- HICON m_hIcon;
- // 生成的消息映射函数
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- DECLARE_MESSAGE_MAP()
- public:
- CListCtrl m_controlLocalFile;
- CListCtrl m_controlServerFile;
- CComboBoxEx m_controlLocalDir;
- CComboBoxEx m_controlServerDir;
- CString m_strPassWord;
- CString m_strServerAddress;
- CString m_strUserName;
- CString m_strMessage;
- int m_nPort;
- BOOL m_PASV;
- BOOL m_bHaveDotFlag;
- MyFtpClient ftp;
- CImageList* m_pDragImageList;
- CImageList m_ctImageList;
- int m_fileDirCount;
- typedef struct
- {
- char sFileName[200];
- char sFileDate[30];
- char sFileSize[20];
- int n_Type;
- }FTP_FILE_INFO;
- afx_msg void OnButtonConnect();
- afx_msg void OnNMDblclkListLocalFiles(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnNMDblclkListServerFiles(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnCbnSelchangeComboLocaldir();
- void OnInsertFile(CListCtrl* pListCtrl, LPVOID pIn, LPARAM lParam);
- void GetFileIcon(CString&fileName, int* iIcon, int* iIconSel);
- BOOL SetImageList(CListCtrl* pListCtrl, CComboBoxEx* pCombo);
- protected:
- void SetFileColumns(CListCtrl* pListCtrl);
- public:
- void GetLocalDir(void);
- int InsertLocalDir(CString& str, int iIcon, int iIconSel);
- void GetLocalCurrentDir(void);
- BOOL BeginFindLocalFile(void);
- void FindLocalFile(void);
- void SetServerDir(CString str);
- UINT FindServerFile(void);
- void AddLine(CString strLine);
- BOOL AddItem(MyFtpList* pItem);
- void SetServerFileColumns(CListCtrl* pListCtrl);
- void CD(CString dir);
- void Back(void);
- void UpLoadFile(CString LocalFilePath, CString LocalFileName, bool pasv, bool get);
- void DownLoadFile(CString ServerFilePath, CString ServerFileName, bool pasv, bool get);
- afx_msg LRESULT OnReDisplayLocalFile(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnSetLocalDirDisplay(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnInsertLocalFile(WPARAM wParam,LPARAM lParam);
- afx_msg LRESULT OnSetRedrawFlag(WPARAM wParam, LPARAM lParam);
- afx_msg LRESULT OnSetLocalDir(WPARAM wParam, LPARAM lParam);
- afx_msg void OnBnClickedCanceal();
- };
- #endif