If IsPostBack = False Then
For Each ActivityFileInfo As IO.FileInfo In New IO.DirectoryInfo(Server.MapPath(".") & "\ActivityFiles\").GetFiles("*.txt")
If DateDiff(DateInterval.Day, ActivityFileInfo.CreationTime, Now) > 6 Then
ActivityFileInfo.Delete()
End If
Next ActivityFileInfo
End If
Tips and tricks for .NET using ASP and VB code.
Delete files in a folder that are over a week old
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment