How do you get the date modified from a file on an FTP server in visual basic?
This is what I have so far:
Dim request = CType(WebRequest.Create(URL + ZipFile), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.GetDateTimestamp
I've tried a couple lines afterwards but none actually return the date.
Well I figured it out, but I'll leave this here since I couldn't find any other vb.net posts about this:
Imports System.Net
Imports System.Globalization
Dim request = CType(WebRequest.Create(URL + ZipFile), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.GetDateTimestamp
Dim response = CType(request.GetResponse(), FtpWebResponse)
Dim ServerDate = DateTime.ParseExact(response.StatusDescription.Substring(4,14),"yyyyMMddHHmmss",_
Cultureinfo.InvariantCulture,DateTimeStyles.None)