Get the file with the oldest creation date in FTP SERVER

  • Thread starter Thread starter iggarci2
  • Start date Start date
I

iggarci2

Guest
I write the next code that give me a list with the files in /DocXML.

I want is to get the file with the oldest creation date. How I can do?

Thanks for all.


private void button2_Click(object sender, EventArgs e)
{
ftp.DownloadFile(textBox1.Text, textBox7.Text);
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://192.168.47.1/DocXML");
request.Method = WebRequestMethods.Ftp.ListDirectory;
request.Credentials = new NetworkCredential("username", "password");

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

Stream responseStream = response.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);

string names = reader.ReadToEnd();

textBox12.Text = names;
}

Continue reading...
 
Back
Top