﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-cowell</title><link>http://www.cppblog.com/cowell/</link><description /><language>zh-cn</language><lastBuildDate>Sat, 11 Apr 2026 10:37:42 GMT</lastBuildDate><pubDate>Sat, 11 Apr 2026 10:37:42 GMT</pubDate><ttl>60</ttl><item><title>FTP Trans file low level coding implementation...</title><link>http://www.cppblog.com/cowell/archive/2014/11/11/208845.html</link><dc:creator>xuqi</dc:creator><author>xuqi</author><pubDate>Tue, 11 Nov 2014 10:36:00 GMT</pubDate><guid>http://www.cppblog.com/cowell/archive/2014/11/11/208845.html</guid><wfw:comment>http://www.cppblog.com/cowell/comments/208845.html</wfw:comment><comments>http://www.cppblog.com/cowell/archive/2014/11/11/208845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/cowell/comments/commentRss/208845.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cowell/services/trackbacks/208845.html</trackback:ping><description><![CDATA[<p style="margin:0in;font-family:Calibri;font-size:11.0pt">#include &lt;stdio.h&gt;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">#include &lt;windows.h&gt;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">#include &lt;wininet.h&gt;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">#include &lt;process.h&gt;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">#pragma comment(lib, "WININET.LIB")</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">int main()</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">{</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">BOOL bSuccess;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">HINTERNET hIntSession;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">HINTERNET hFtpSession;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">//HINTERNET hFind;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">//char szBuffer[64];</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">//WIN32_FIND_DATA findData;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szAppName[] = "mydll";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szServer[] = "192.168.101.225";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szUser[] = "qpid";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szPwd[] = "qpid";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szDirectory[] = "/home/qpid/mydll";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szFile[] = "mylib.dll";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szCurDir[MAX_PATH];</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">char szNewFile[] = "c:\\mylib.dll";</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">DWORD dwCurDir = MAX_PATH;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("try to open intSession...\n");</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">hIntSession = InternetOpen(szAppName, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">if(hIntSession == NULL) </p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">{</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">printf("can not open intSession!\n");</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">return -1;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">}</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("intSession is open!\n");</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("try to open ftpSession...\n");</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">hFtpSession = InternetConnect(hIntSession, szServer, INTERNET_DEFAULT_FTP_PORT, szUser, szPwd, INTERNET_SERVICE_FTP, 0, 0);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">if(hFtpSession == NULL) </p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">{</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">InternetCloseHandle(hIntSession);</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">printf("can not open ftpSession!\n");</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">return -1;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">}</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("ftpSession is open!\n");</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">ZeroMemory(szCurDir, sizeof(szCurDir));</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">FtpGetCurrentDirectory(hFtpSession, szCurDir, &amp;dwCurDir);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("current dir is %s .\n", szCurDir);</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("try to set current directory...\n");</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">bSuccess = FtpSetCurrentDirectory(hFtpSession, szDirectory);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">if(!bSuccess)</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">{</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">InternetCloseHandle(hFtpSession);</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">InternetCloseHandle(hIntSession);</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">printf("can not set directory!\n");</p>  <p style="margin:0in;margin-left:.75in;font-family:Calibri;font-size:11.0pt">return -1;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">}</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("set directory ok!\n");</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">printf("try to get file...\n");</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">FtpGetFile(hFtpSession, szFile, szNewFile, TRUE, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, 0);</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">//InternetCloseHandle(hFind);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">InternetCloseHandle(hFtpSession);</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">InternetCloseHandle(hIntSession);</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>  <p style="margin:0in;margin-left:.375in;font-family:Calibri;font-size:11.0pt">return 0;</p>  <p style="margin:0in;font-family:Calibri;font-size:11.0pt">}</p><img src ="http://www.cppblog.com/cowell/aggbug/208845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cowell/" target="_blank">xuqi</a> 2014-11-11 18:36 <a href="http://www.cppblog.com/cowell/archive/2014/11/11/208845.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>删除FTP服务器文件递归伪代码  </title><link>http://www.cppblog.com/cowell/archive/2014/11/11/208844.html</link><dc:creator>xuqi</dc:creator><author>xuqi</author><pubDate>Tue, 11 Nov 2014 10:35:00 GMT</pubDate><guid>http://www.cppblog.com/cowell/archive/2014/11/11/208844.html</guid><wfw:comment>http://www.cppblog.com/cowell/comments/208844.html</wfw:comment><comments>http://www.cppblog.com/cowell/archive/2014/11/11/208844.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/cowell/comments/commentRss/208844.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cowell/services/trackbacks/208844.html</trackback:ping><description><![CDATA[<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">//</span><span style="font-family:SimSun">伪代码</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp;void DeleteFtpDiretoryFile(string path)</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (path is file)//</span><span style="font-family:SimSun">文件直接删除</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.DeleteFileName(path);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; //path</span><span style="font-family: SimSun">为文件夹，获取文件夹下的文件列表</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;string&gt; listFileName = new List&lt;string&gt;();</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetFileList(listFileName);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (listFileName.Count &lt; 1)</p>  <p style="margin: 0in; line-height: 21pt; font-family: Calibri; font-size: 12pt; color: #2c2c2c;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">//</span><span style="font-family:SimSun">该文件夹为空文件夹，直接删除</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.delDir(path);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; //</span><span style="font-family: SimSun">遍历</span><span style="font-family:Calibri">path</span><span style="font-family:SimSun">文件夹</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (string strFileName in listFileName)</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; string strChildFilePaht = path +'/' + strFileName;</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (IsDiretory(strChildFilePaht))//</span><span style="font-family:SimSun">子文件夹递归处理</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeleteFtpDiretoryFile(strChildFilePaht);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; &nbsp;//</span><span style="font-family: SimSun">文件直接删除</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.DeleteFileName(strChildFilePaht);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>  <p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; //path</span><span style="font-family: SimSun">文件夹下东西都删除了，删除空文件夹</span></p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.delDir(path);</p>  <p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; }</p><img src ="http://www.cppblog.com/cowell/aggbug/208844.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cowell/" target="_blank">xuqi</a> 2014-11-11 18:35 <a href="http://www.cppblog.com/cowell/archive/2014/11/11/208844.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>递归下载FTP服务器文件  </title><link>http://www.cppblog.com/cowell/archive/2014/11/11/208843.html</link><dc:creator>xuqi</dc:creator><author>xuqi</author><pubDate>Tue, 11 Nov 2014 10:34:00 GMT</pubDate><guid>http://www.cppblog.com/cowell/archive/2014/11/11/208843.html</guid><wfw:comment>http://www.cppblog.com/cowell/comments/208843.html</wfw:comment><comments>http://www.cppblog.com/cowell/archive/2014/11/11/208843.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/cowell/comments/commentRss/208843.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/cowell/services/trackbacks/208843.html</trackback:ping><description><![CDATA[<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">//</span><span style="font-family:SimSun">伪代码</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">void DownLoadFtpDiretoryFile(string ftpPath, string LocalPath)</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ftpPath is file)//</span><span style="font-family:SimSun">文件直接下载</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.Download(ftpPath, LocalPath);</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Directory.IsExists(LocalPath))//</span><span style="font-family: SimSun">服务器文件夹，先确认本地文件夹是否存在</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Directory.CreateDirectory(LocalPath);</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;string&gt; listFileName = new List&lt;string&gt;();</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.GetFileList(listFileName); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p>
<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; &nbsp;//</span><span style="font-family: SimSun">遍历</span><span style="font-family:Calibri">ftpPath</span><span style="font-family:SimSun">下的文件</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach (string strFileName in listFileName)</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (IsDiretory(strFileName ))//</span><span style="font-family:SimSun">是文件夹就递归</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DownLoadFtpDiretoryFile(strFtpChildFilePaht, strLocalChildFilePaht);</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</p>
<p style="margin:0in;line-height:21pt;font-size:12.0pt;color:#2C2C2C"><span style="font-family:Calibri">&nbsp;&nbsp; &nbsp;//</span><span style="font-family: SimSun">是文件，直接下载</span></p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_ftpAdapter.Download(strFtpChildFilePaht, strLocalChildFilePaht);</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;line-height:21pt;font-family:Calibri;font-size:12.0pt; color:#2C2C2C">&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p style="margin:0in;font-family:Calibri;font-size:11.0pt">&nbsp;</p>
<img src ="http://www.cppblog.com/cowell/aggbug/208843.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/cowell/" target="_blank">xuqi</a> 2014-11-11 18:34 <a href="http://www.cppblog.com/cowell/archive/2014/11/11/208843.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>