B
BRIAN
I am tyrying to use the System.IO.File.GetCreationTime
name space to get the creation date of a file. That's no
problem.
I want to delete a file if it is older than two weeks.
For Each File1 In Directory.GetFiles("c:\Test")
If CreationDate < (System.DateTime.Now( ) - 14) Then
File.Delete(File1)
End If
Next
my error is at (system.datetime.now() - 14)
says operator '-' is not defined for datetime or integer.
Does anyone know how to subtract a number of days from a
date that is not in datetime format?
Thanks
name space to get the creation date of a file. That's no
problem.
I want to delete a file if it is older than two weeks.
For Each File1 In Directory.GetFiles("c:\Test")
If CreationDate < (System.DateTime.Now( ) - 14) Then
File.Delete(File1)
End If
Next
my error is at (system.datetime.now() - 14)
says operator '-' is not defined for datetime or integer.
Does anyone know how to subtract a number of days from a
date that is not in datetime format?
Thanks