By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,501 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,501 IT Pros & Developers. It's quick & easy.

Retrieving File Modified Date

P: 13
Hi All,

I'm using 2003 Standard Edition, and I'm trying to retrieve the file modified date. Sounds painfully simple. Yup. But ... I cannot, for the life of me, figure it out. After numerous Google searches with no joy, I decided either the answer was so simple nobody ever asked the question, or ... you needed to be on NASA's payroll to comprehend the answer :)

I've created a System.IO.FileInfo object, and have collected info from the three methods: CreationTime, LastAccessTime, and LastWriteTime, but they aren't giving me the same data as XP Windows Explorer is.

In Explorer, there is a Date Modified field (currently reading 2008 on the file in question), but using the FileInfo methods they return 2007, 2009, 2009.

Is there another IO object I can use to get this 'modified' date? Or, does anyone know the API routine that will yield the same results?

Many Thanks,
Apr 5 '09 #1
Share this Question
Share on Google+
1 Reply

P: 13
For some reason (probably one of those 'problem between keyboard and chair' errors), using FileInfo.LastWriteTime is yielding the correct results, displaying exactly what Explorer does as its 'Date Modified' field.

Problem solved. I think I was the problem ...
Apr 5 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.