C# FTP 读取一个文件夹的所有文件按创建或者修改顺序排序-怎么做
C# FTP 读取一个文件夹的所有文件按创建或者修改顺序排序-怎么做?急求助public bool GetFileList(string filePattern, ref string[] fileList, ref string strErr)
{
bool bRet = false;
try
{
StringBuilder result = new StringBuilder();
string uri = "ftp://" + ftpServerIP + ":" + ftpPort;
if (ftpDictionary != "") { uri += "/" + ftpDictionary; }
uri += "/";
strErr = Connect(uri);//连接
if (strErr != "")
{
//dispose
return bRet;
}
reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
reqFTP.KeepAlive = false;
WebResponse response = reqFTP.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.Default);//中文文件名
string line = reader.ReadLine();
while (line != null)
{
result.Append(line);
result.Append("\n");
line = reader.ReadLine();
}
reader.Close();
response.Close();
fileList= result.ToString().Spli
}