I’ve got a folder path. The folder contains a lot of files as well as some subfolders. I’d like to let the user delete the files (but not the folders) using the standard windows dialog.
I’m currently using this code, which deletes the whole folder.
Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory (
path,
UIOption.AllDialogs,
RecycleOption.SendToRecycleBin,
UICancelOption.DoNothing);
I’m aware I could enumerate all files and prompt the user for each file, but that’s not practical at all.
Why not just write a function for this specific task?
ah ok, just a suggestion..
then have a look at this:
http://www.blackwasp.co.uk/RecycleBin2.aspx
used like this to delete all files matching the
*.*pattern in a folder: