vb ftp client

hi to all,
i try to list a directory from ftp. i connect it through a browser so i can see file's datetime detail. But when i connect with Net.WebRequestMethods.Ftp.ListDirectoryDetails it's return wrong  datetime format. what can i do?
response is here, datetime is not properly.

-rw-r--r-- 1 ftp ftp          19143 May 05 18:05 MoH_Items_AEE1.1100000000000025.xml
-rw-r--r-- 1 ftp ftp           1248 Nov 25  2008 test file inbound.txt
-rw-r--r-- 1 ftp ftp           2652 May 05 18:05 Yildrim_Items_AEE1.1100000000000025.xml

erenpasaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oobaylyCommented:
I assume you're using the System.Net.FtpWebRequest. What you're getting is the raw text response from the FTP server, exactly the same as if you were to use the ftp command in the command prompt window and use LIST. It's your job to parse it into something workable. The reason it works in the browser is that it does the parsing for you browser does this parsing and then renders it for you.

Unfortunately, the response will depend on the server you've connected to, as you can see from these three examples, but as you can see you are clearly connecting to a FTP server running on a *nix machine.
// ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/7.2/
// FTP server (Version 6.00LS)
total 4408372
-rw-r--r--  1 1006  1006    39122944 May  1 20:51 7.2-RELEASE-i386-bootonly.iso
-rw-r--r--  1 1006  1006   587503616 May  1 20:53 7.2-RELEASE-i386-disc1.iso
-rw-r--r--  1 1006  1006   632199168 May  1 20:55 7.2-RELEASE-i386-disc2.iso
-rw-r--r--  1 1006  1006   670683136 May  1 20:57 7.2-RELEASE-i386-disc3.iso
-rw-r--r--  1 1006  1006   308367360 May  1 21:08 7.2-RELEASE-i386-docs.iso
-rw-r--r--  1 1006  1006  2040369172 May  1 21:06 7.2-RELEASE-i386-dvd1.iso.gz
-rw-r--r--  1 1006  1006   233490432 May  1 21:09 7.2-RELEASE-i386-livefs.iso
-rw-r--r--  1 1006  1006         478 May  1 21:10 CHECKSUM.MD5
-rw-r--r--  1 1006  1006         723 May  1 21:12 CHECKSUM.SHA256
 
// ftp://ftp.microsoft.com/developr/adc/
// Microsoft FTP Service
01-25-07  12:18PM       <DIR>          ADCBeta
04-08-97  04:37PM                  742 index.txt
06-25-97  09:12AM              1856528 msadc10.exe
06-25-97  09:12AM               932360 msadcdoc.exe
06-25-97  09:12AM               613384 MSADCQRY.EXE
06-25-97  09:13AM              1206288 msadcrnk.exe
12-16-96  06:17PM                37270 readme.txt
 
// ftp://ftp.ubuntu.com/ubuntu/
// Ubuntu FTP server (vsftpd)
-r--r--r--    1 1001     1001            1 May 26 10:56 Archive-Update-in-Progress-leningradskaya.canonical.com
drwxrwsr-x   27 1001     1001         4096 Apr 23 14:16 dists
drwxrwsr-x    2 1001     1001        57344 May 26 09:42 indices
-rw-r--r--    1 1001     1001      7371735 May 26 09:41 ls-lR.gz
drwxrwsr-x    6 1001     1001         4096 Jan 14  2008 pool
drwxrwsr-x    3 1001     1001         4096 Feb 13  2008 project

Open in new window

0
erenpasaAuthor Commented:
hi oobayl,
you are right. but 1. and 3. files does't have year information? it's date show on browser 2009. may i think like this if file's date is current year ftp server doesn't return it. if it's a different year it's return it.
0
oobaylyCommented:
What you'll find is that the LIST command will return (on *nix systems anyway) something similar to using the ls -l command in a shell.
As you can see, the time is given if the file was modified in the last year (not current year). You will see the same effect if you go to this url ftp://ftp.ubuntu.com/ubuntu/dists/dapper/
Notice that the files that are from before 26 May 2008 do not have a modified time.
-rw-rw-r--    1 1001     1001      9774480 Dec 16 06:10 Contents-amd64.gz
-rw-rw-r--    1 1001     1001     10198508 Dec 16 05:59 Contents-i386.gz
-rw-rw-r--    1 1001     1001      9777703 Dec 16 06:05 Contents-powerpc.gz
-rw-rw-r--    1 1001     1001      9645520 Dec 16 06:08 Contents-sparc.gz
-rw-r--r--    1 1001     1001        34750 May 31  2006 Release
-rw-r--r--    1 1001     1001          189 May 31  2006 Release.gpg
drwxr-sr-x   14 1001     1001         4096 Nov 07  2008 main
drwxr-sr-x    8 1001     1001         4096 Oct 24  2005 multiverse
drwxr-sr-x    8 1001     1001         4096 Oct 24  2005 restricted
drwxr-sr-x    8 1001     1001         4096 Oct 24  2005 universe

Open in new window

0
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

oobaylyCommented:
Apologies, ignore my comment about the last year (and 26th May 2008), it doesn't appear to be a full rolling year. I think more investigation into the logic used to display year or time is needed.
0
oobaylyCommented:
Here we go, it's not a 12 months, but 6 months:
"If the modification time of the file is more than 6 months in the past or future, then the year of the last modification is displayed in place of the hour and minute fields."
http://www.manpagez.com/man/1/ls/

So, any files created before the 26 Nov 2008 will have no modified time returned, which tallies with the example I posted. Sorry about the confusion.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
erenpasaAuthor Commented:
thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.