簡單對Filezilla Server 0.9.39源代碼進行分析,參考了《FileZilla
Server源碼分析 》 和《FileZilla FTP服務器源代碼分析》的內容。
首先下載相關的文件:
1、FileZilla_Server-0_9_39.exe
2、zlib-1.2.5.tar.bz2
3、tinyxml_2_6_2.zip
安裝FileZilla_Server-0_9_39.exe時,選擇Source Code,如下圖:
使用VS2005編譯Boost庫:(注:0.9.39已經移除了對Boost庫的依賴,可以不用編譯了)
cd E:\FileZilla\boost_1_47_0\tools\build\v2
bootstrap.bat
copy bjam.exe E:\FileZilla\boost_1_47_0\
cd E:\FileZilla\boost_1_47_0\
bjam --prefix=E:\FileZilla\boost --build-type=minimal toolset=msvc install
會在E:\FileZilla\boost 目錄下生成Boost庫文件。
使用VS2005編譯Zib庫:
用vs2005 打開E:\FileZilla\zlib-1.2.5\old\visualc6目錄下的zlib.dsp
分別生成,選擇LIB Debug 和 LIB Release,會在E:\FileZilla\zlib-1.2.5\old\visualc6目錄下生成相應的文件
使用VS2005編譯Filezil Server:
爲了能在VS2005上編譯FileZilla Server 源代碼,將FileZilla server.vcproj 和FileZilla Server Interface.vcproj的第4行改爲:
Version="8.00"
將FileZilla server.sln的第一行和第二行改爲:
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
現在可以用VS2005打開 FileZilla server.sln 項目文件了,打開時會提示找不到GFTP項目,可以忽略。
將Service設爲啓動項目;
項目屬性-配置屬性-C/C++-常規-附加包含目錄:"E:\FileZilla\zlib-1.2.5"
將E:\FileZilla\zlib-1.2.5\old\visualc6\Win32_LIB_Debug\zlibd.lib 拷貝到根目錄(E:\FileZilla\source)下
項目屬性-配置屬性-鏈接器-輸入-忽略特定的庫:libcmtd.lib
項目屬性-配置屬性-鏈接器-輸入-附加依賴項:atlsd.lib
現在應該可以編譯運行了。
修改好的源代碼:source.rar
由於Windows服務程序調試比較困難,將原程序修改爲執行程序,方便調試,
僅供研究學習,勿用於其他用途:修改後的服務器端源代碼
轉自:http://www.cppblog.com/eamon100/articles/155695.html
轉自:http://blog.csdn.net/sondx/article/details/7645126
轉自:http://fyscu.com/forum.php?mod=viewthread&tid=650
轉自:http://blog.csdn.net/flymachine/article/details/7400334(MFC疑難註解:CAsyncSocket及CSocket )