Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
23.1k views
in .NET FTP by (160 points)
Hi,

i have some problems using FTPClient.DirDetails().
In some cases, calling DirDetails(path) throws following Exception:

System.FormatException: String was not recognized as a valid DateTime.
at EnterpriseDT.Net.Ftp.FTPFileFactory.Parse(String[] files)
at EnterpriseDT.Net.Ftp.FTPClient.DirDetails(String dirname)

Maybe there is a problem parsing date values with a leading zero? For example 'mar 03'

Thanks in advance

16 Answers

0 votes
by (140 points)
I also receive this exception.

Exception: String was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseFormatError(Boolean isThrowException, String resourceID)
   at System.DateTimeParse.ParseDigits(__DTString str, Int32 digitLen, Boolean isThrowExp, Int32& result)
   at System.DateTimeParse.ParseByFormat(__DTString str, __DTString format, ParsingInfo parseInfo, DateTimeFormatInfo dtfi, Boolean isThrowExp, DateTimeResult result)
   at System.DateTimeParse.DoStrictParse(String s, String formatParam, DateTimeStyles styles, DateTimeFormatInfo dtfi, Boolean isThrowExp, DateTime& returnValue)
   at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
   at EnterpriseDT.Net.Ftp.WindowsFileParser.Parse(String raw)
   at EnterpriseDT.Net.Ftp.FTPFileFactory.Parse(String[] files)
   at EnterpriseDT.Net.Ftp.FTPClient.DirDetails(String dirname)
   at Scan.frm_Main.b_Login_Click(Object sender, EventArgs e) in c:\development\scan\frm_main.cs:line 1458



Output from a directory listing is:

drwxr-xr-x   2 user site46       3072 Dec  8 15:22 oct21
drwxr-xr-x   2 user site46       3072 Dec 26 12:26 oct22
drwxr-xr-x   2 user site46       3072 Dec 26 13:15 oct23
drwxr-xr-x   2 user site46       3072 Dec 26 13:54 oct24


The issue is directly related to the fact that I am have my development machine set to nb_NO culture (Bokm
0 votes
by (162k points)
We plan to permit the setting of the culture by users, and use the InvariantCulture as the default.

It seems that using the InvariantCulture is the best default to use, but this will need to be overridden if the FTP server is using a different language. This can't easily be detected by the client , so we will provide a method allowing the culture to be set just for DirDetails date parsing.

Any comments welcome ... thanks
0 votes
by
Hi

Do you know, when the bugfix about the DirDetails is available?
I used the library for a project...
Do you have a schedule?

Thanks a lot - tom
0 votes
by (162k points)
We expect a release that permits the setting of the Culture to be released by mid-Jan, perhaps earlier.

Hi

Do you know, when the bugfix about the DirDetails is available?
I used the library for a project...
Do you have a schedule?

Thanks a lot - tom
0 votes
by
i have the same problem, but when i put my "regional settings" to "great britain" i don't have anymore the error!
but i want to stay in my original regional settings!
when the fix can be available?
regards!
0 votes
by (162k points)
We've been a bit busy, we hope to release this by 11 Feb, hopefully sooner.

i have the same problem, but when i put my "regional settings" to "great britain" i don't have anymore the error!
but i want to stay in my original regional settings!
when the fix can be available?
regards!

Categories

...