1
這裏的FTP站點上返回最早的文件的名稱是我到目前爲止有:試圖在C#
FtpWebRequest reqFTP;
string returnString = "";
Uri serverFile = new Uri(ftpServer + "/" + dirName);
reqFTP = (FtpWebRequest)FtpWebRequest.Create(serverFile);
reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
reqFTP.UseBinary = true;
reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPass);
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
long cl = response.ContentLength;
int bufferSize = 2048;
int readCount;
byte[] buffer = new byte[bufferSize];
readCount = ftpStream.Read(buffer, 0, bufferSize);
while (readCount > 0)
{
returnString += System.Text.ASCIIEncoding.ASCII.GetString(buffer);
readCount = ftpStream.Read(buffer, 0, bufferSize);
}
什麼,這似乎做的是恢復我的格式化字符串的所有文件的細節在目錄中。是否有可能得到一個單一的文件(基於像創建日期這樣的標準),還是有一個庫會爲我解析這個字符串?