Hello i would like to know how to make a program the deletes external files. Like say if someone needs to delete a group of old files he has he types something in my program does the settings i provide and it will delete the files.
Printable View
Hello i would like to know how to make a program the deletes external files. Like say if someone needs to delete a group of old files he has he types something in my program does the settings i provide and it will delete the files.
Is this what you mean?vb.net Code:
System.IO.File.Delete("d:\yourfile.txt")
Read up the documentation for System.IO.File class or System.IO.FileInfo class. In order to delete "old files", you first must know how old a file is. And to find out how old a file is, you compare the current date and time to the file's creation date and time stamp. You will also need to use some methods in System.IO.Directory class to get a list of files in a folder, so read up on that class too.
Thankyou for your help