ftp server 源代码

时间:2012-10-28 07:54:30
【文件属性】:
文件名称:ftp server 源代码
文件大小:143KB
文件格式:RAR
更新时间:2012-10-28 07:54:30
ftp server 源代码 // FTPServer.h: interface for the CFTPServer class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_FTPSERVER_H__144E8B64_2004_4709_B55A_242FE5F07BD2__INCLUDED_) #define AFX_FTPSERVER_H__144E8B64_2004_4709_B55A_242FE5F07BD2__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "ConnectThread.h" #include "ListenSocket.h" #include "FTPEventSink.h" #include "UserManager.h" #include "SecurityManager.h" class CFTPServer : public CWnd { friend CConnectSocket; public: void SetGoodbyeMessage(LPCTSTR lpszText); void SetWelcomeMessage(LPCTSTR lpszText); void SetTimeout(int nValue); void SetPort(int nValue); void SetMaxUsers(int nValue); void SetStatisticsInterval(int nValue); BOOL IsActive(); void Stop(); BOOL Start(); CFTPServer(); virtual ~CFTPServer(); CUserManager m_UserManager; CSecurityManager m_SecurityManager; CCriticalSection m_CriticalSection; // list of thread pointers CTypedPtrList m_ThreadList; int GetPort() { return m_nPort; }; int GetMaxUsers() { return m_nMaxUsers; } int GetTimeout() { return m_nTimeout; } int GetConnectionCount() { return m_nConnectionCount; } CString GetWelcomeMessage() { return m_strWelcomeMessage; }; CString GetGoodbyeMessage() { return m_strGoodbyeMessage; }; void AddTraceLine(int nType, LPCTSTR pstrFormat, ...); private: // socket member that listens for new connections CListenSocket m_ListenSocket; CFTPEventSink *m_pEventSink; int m_nPort; int m_nMaxUsers; CString m_strWelcomeMessage; CString m_strGoodbyeMessage; int m_nTimeout; BOOL m_bRunning; // statistics DWORD m_dwTotalReceivedBytes; DWORD m_dwTotalSentBytes; int m_nConnectionCount; int m_nTotalConnections; int m_nFilesDownloaded; int m_nFilesUploaded; int m_nFailedDownloads; int m_nFailedUploads; // Operations public: BOOL IsIPAddressAllowed(LPCTSTR lpszIPAddress); void SetSecurityMode(BOOL bBlockSpecific = TRUE); BOOL CheckMaxUsers(); void Initialize(CFTPEventSink *pEventSink); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CFTPServer) //}}AFX_VIRTUAL // Generated message map functions protected: int m_nSecurityMode; int m_nStatisticsInterval; //{{AFX_MSG(CFTPServer) afx_msg void OnTimer(UINT nIDEvent); //}}AFX_MSG LRESULT OnThreadClose(WPARAM wParam, LPARAM lParam); LRESULT OnThreadStart(WPARAM wParam, LPARAM); LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam); DECLARE_MESSAGE_MAP() }; #endif // !defined(AFX_FTPSERVER_H__144E8B64_2004_4709_B55A_242FE5F07BD2__INCLUDED_)
【文件预览】:
ftpserversrc
----ConnectThread.cpp(7KB)
----ConnectSocket.h(2KB)
----UserManager.h(2KB)
----TabCtrlEx.cpp(3KB)
----TracePage.cpp(4KB)
----ColorListBox.h(1KB)
----StdAfx.cpp(10KB)
----InfobarCtrl.h(1KB)
----resource.h(8KB)
----ListenSocket.h(1KB)
----AboutDlg.cpp(1001B)
----ConfigurationPage.cpp(9KB)
----UserAccountsDlg.h(2KB)
----SystemTray.h(1KB)
----UserAccountsDlg.cpp(26KB)
----DialogResize.h(3KB)
----SecurityManager.cpp(5KB)
----StarWarsCtrl.cpp(13KB)
----WizardPages.h(6KB)
----LogFile.h(2KB)
----StarWarsCtrl.h(2KB)
----FTPEventSink.cpp(451B)
----ApplicationDlg.h(4KB)
----SecurityManager.h(1KB)
----DataSocket.h(1KB)
----FTPServer.rc(23KB)
----AddIPDlg.cpp(3KB)
----OnlineUsersPage.h(2KB)
----ConnectSocket.cpp(31KB)
----StatisticsPage.h(1KB)
----ShFolder.h(3KB)
----LogFile.cpp(11KB)
----InfobarCtrl.cpp(8KB)
----AddUserDlg.h(1KB)
----AboutDlg.h(1KB)
----AddIPDlg.h(1KB)
----UserManager.cpp(20KB)
----FTPServer.dsw(541B)
----Debug()
----TabCtrlEx.h(2KB)
----StatisticsPage.cpp(2KB)
----StdAfx.h(2KB)
----FTPEventSink.h(948B)
----ListenSocket.cpp(3KB)
----DataSocket.cpp(15KB)
----TracePage.h(2KB)
----WizardPages.cpp(12KB)
----SecurityPage.h(2KB)
----FTPServer.opt(53KB)
----ColorListBox.cpp(4KB)
----ConfigurationPage.h(2KB)
----FTPServer.dsp(9KB)
----ApplicationDlg.cpp(39KB)
----AddUserDlg.cpp(1KB)
----Release()
----FTPServerApp.h(1KB)
----ConnectThread.h(2KB)
----DirectoryDlg.cpp(3KB)
----res()
--------xptheme.bin(644B)
--------configur.ico(766B)
--------users.ico(766B)
--------icon2.ico(766B)
--------led_red.ico(1KB)
--------settings.ico(766B)
--------user.ico(318B)
--------FTPServer.rc2(400B)
--------statistics.ico(766B)
--------led_off.ico(1KB)
--------watermark.bmp(76KB)
--------banner.bmp(14KB)
--------led_gree.ico(1KB)
--------none.ico(318B)
--------toolbar1.bmp(718B)
--------ftp.ico(5KB)
--------icon1.ico(318B)
----FTPServer.cpp(12KB)
----FTPServer.plg(252B)
----OnlineUsersPage.cpp(7KB)
----FTPServer.h(3KB)
----SecurityPage.cpp(12KB)
----FTPServerApp.cpp(4KB)
----DirectoryDlg.h(1KB)
----FTPServer.ncb(177KB)
----SystemTray.cpp(5KB)
----DialogResize.cpp(11KB)

网友评论

  • 11下载看看 测试下
  • 不错,值得参考
  • 功能很全面,代码结构也很清晰,值得学习
  • VC2010编译不过,可以借鉴学习
  • 功能太强大,看得很费劲…… VC6.0的工程,少了clw文件
  • 我用VS 2010 编译了下,好像不行.
  • VS 2008 和 vs 2010均不能编译通过。 应该是字符转换方面的问题