Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27153

VS 2010 Getting CreationDateTime of File on FTP

$
0
0
Hi,

I hope someone can help. I am scanning Clients FTP's to see if they have placed files for us to use - Which is working 100% - Getting the File Names ect.

However, I now need to get the actual CreationDate and Time for each file. I have googled quite a bit and cant find anything that really helps. I have even tried creating my own function, which doesnt work :

Public Function GetFileCreationDate(ByVal filename As String) As DateTime
Dim path As String
If filename.Contains("/") Then
path = AdjustDir(filename)
Else
path = Me.CurrentDirectory & filename
End If
Dim URI As String = Me.Hostname & path
Dim ftp As Net.FtpWebRequest = GetRequest(URI)
ftp.Proxy = Nothing

'Try to get info on file/dir?
ftp.Method = Net.WebRequestMethods.Ftp.GetDateTimestamp
Dim tmp As DateTime = Me.GetFileCreationDate(path) <--------------------
Return tmp
End Function

I however get an error : An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

The error happens on the line specified above.

1. What am I doing wrong ? 2. Is there possibly a function someone has that I can use to get the CreationDateTime from a File ON the FTP. I do not want to download the file to my PC/Server and then Grab the CreationDate from that, as this then takes the Date and time when the file was downloaded.

Hope someone can help and Thanks in Advance!

Kind regards,
AxleWack

Viewing all articles
Browse latest Browse all 27153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>