Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3k views
in .NET FTP by
Sorry about my english :)
i used DirDetails on FTP server with Pt_BR culture info and i got this error message: "String was not recognized as a valid DateTime.".
I debug the edftp API and found the exception at public class UnixFileParser:FTPFileParser line 229 "lastModified = DateTime.ParseExact(stamp.ToString(), format2, ParsingCulture.DateTimeFormat, DateTimeStyles.None);"

I solve the error change in FTPFileParser class
line 79: private CultureInfo parserCulture = CultureInfo.InvariantCulture;

to

private CultureInfo parserCulture = CultureInfo.CurrentCulture;

Now it work fine for me

1 Answer

0 votes
by (161k points)
For various reasons the InvariantCulture is the best option here, see

http://www.enterprisedt.com/forums/view ... 76&start=0 for more info.

However there is a property on FTPClient called ParsingCulture that allows you to set the culture programmatically.

Sorry about my english :)
i used DirDetails on FTP server with Pt_BR culture info and i got this error message: "String was not recognized as a valid DateTime.".
I debug the edftp API and found the exception at public class UnixFileParser:FTPFileParser line 229 "lastModified = DateTime.ParseExact(stamp.ToString(), format2, ParsingCulture.DateTimeFormat, DateTimeStyles.None);"

I solve the error change in FTPFileParser class
line 79: private CultureInfo parserCulture = CultureInfo.InvariantCulture;

to

private CultureInfo parserCulture = CultureInfo.CurrentCulture;

Now it work fine for me

Categories

...