PDA

View Full Version : How would


JDog37
12-05-2008, 06:18 PM
Hello all!

How would I be able to use a button to clean out the "Temp, Temp Internet, and Recent" folders in XP? Click it, and it erases contents automatic?? :huh

jassing
12-06-2008, 05:31 AM
Hello all!

How would I be able to use a button to clean out the "Temp, Temp Internet, and Recent" folders in XP? Click it, and it erases contents automatic?? :huh

by use of File.Delete() and delete the files?
recent files is stored in the registry.. so you'd need to use Registry.DeleteKey()

RizlaUK
12-06-2008, 12:35 PM
i posted a dll on the forums somewhere that can add and remove files from the recent files list, temp folders are in common locations so shell.getfolder will do.

siray
12-06-2008, 02:48 PM
maybe something like this:

http://www.indigorose.com/forums/showthread.php?t=23630

JDog37
12-06-2008, 06:37 PM
Thank you guys, all the help is wonderful!

siray, I got your project and I love it, nice work! :yes

Joe

siray
12-06-2008, 08:42 PM
but it still cannot delete locked file(s) with that project :huh ;)

Imagine Programming
12-06-2008, 09:22 PM
Well, don't, because there may be Applications that need those files.
Try to check if the file is in use first, use: File.IsInUse(filename) (returns true if it's in use)
and by that you can skip those files.

It's just not wise to delete temp files that are in use,
it could stall other applications wich may be important. :)

JDog37
12-06-2008, 10:44 PM
Thank all of you. I figured the ones that dont delete are in use.. But I do appreciate all the helpful info!! :yes

Joe