Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper format to read FTP directory
Message
De
10/05/2012 08:00:04
 
 
À
10/05/2012 06:54:39
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01543372
Message ID:
01543405
Vues:
27
>Ummm.
IEnumerable<FTPInfo> result = typeA.Select(x =>
>            {
>                string[] line = ((string)x).Split((char[])null, StringSplitOptions.RemoveEmptyEntries).Take(9).ToArray();
>                return new FTPInfo
>                {
>                    File = x.Substring(x.IndexOf(line.Last())),
>                    Size = line[4],
>                    Month = line[5],
>                    Day = line[6],
>                    YearOrTime = line[7]
>                };
>            });	
(I know. This won't work either if the first word of the file name occurs earlier in the string. I don't want to play any more :-{ )


Not meant to play - just meant to say that string.Split() is not a waterproof solution in this case
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform