I completed a project in VB.NET 2003 and I recently found the need to add a new feature to it.
My program saves a bunch of text files into a folder called Archive.
What I would now like to do is to somehow read that folder and compare the CREATION Dates to Now().
I know the function FileDateTime reads either the Last Accessed or Last Modified date. That is no good because what if I open the text file or if my program does for some reason? then the date changes but the original creation date does not, so I want to read the original creation date.
I noticed in the help files there was a FileCreated function but that was listed under Internet Development SDK....so that doesn't help because I am not developing a web environment....
So I have 3 questions .....
1) How do I get the original creation date of a file? (not the last accessed or last modified dates!!)
2) How do I read the dates of all files in a folder?
3) How do I properly use the DateDiff function for the comparison and then tell VB to tell me all the files that are OLDER than 2 years? (message box or label I dont care)
As an example, every time I try to do something like:
newdate=DateDiff(DateInterval.Day, FileCreatedDate, Now())
I get an Overload error even though FileCreatedDate has a valid date in it.
Enter your message below
Sign in or Join us (it's free).