System.Net.FtpWebRequest GetDateTimestamp example

Yep – thats pretty much what I ended up with. I went with something like this

request = FtpWebRequest.Create("ftp://ftp.whatever.com/somefile.txt");

request.Method = WebRequestMethods.Ftp.GetDateTimestamp;
request.Proxy = null;

using (FtpWebResponse resp = (FtpWebResponse)request.GetResponse())
{
        Console.WriteLine(resp.LastModified);
}

Leave a Comment