Howdy All;
Love the component. It is making my life easier, and I will get my client to license it ASAP.
I found an interesting bug - but it may not be yours.
The environment my code is a "client of" uses a Microsoft Windows FTP server - with it's directory listing set to "Unix". Your "swap parsers" routine works well - the first time it encounters an error (thinking it is going to be MSDOS style listings) - however, the next error encountered is missing "year" information. All fine and dandy - you have code in-place to handle that.
But ... occasionally the timestamp does not include a leading zereo, if the time is less than 10am/pm... boom, another format exception is thrown.
I have managed to find an offending FTP location in the "wild", open
ftp://ftp.microsoft.com as anon, and navigate to the following path:
"/developr/MSDN/NewUp/Glossary"
If you use FTPClient.DirDetails it will generate a "FormatException".
However, I managed a quick fix, and am posting it here, hope it makes it into the next release:
Within the 'UnixFileParser.cs', replace the following lines:
/// <summary>Date format 2</summary>
private const string format2a = "MMM'-'d'-'yyyy'-'HH':'mm";
/// <summary>Date format 2</summary>
private const string format2b = "MMM'-'dd'-'yyyy'-'HH':'mm";
/// <summary>array of format 2 formats</summary>
private string[] format2 = {format2a,format2b};
With:
/// <summary>Date format 2</summary>
private const string format2a = "MMM'-'d'-'yyyy'-'HH':'mm";
/// <summary>Date format 2</summary>
private const string format2b = "MMM'-'d'-'yyyy'-'H':'mm";
/// <summary>Date format 2</summary>
private const string format2c = "MMM'-'dd'-'yyyy'-'HH':'mm";
/// <summary>Date format 2</summary>
private const string format2d = "MMM'-'dd'-'yyyy'-'H':'mm";
/// <summary>array of format 2 formats</summary>
private string[] format2 = {format2a,format2b,format2c,format2d};
Thanks again!