As I see it, the SHFileOperation is a better choice just for being more flexible. That of course comes at a price of extra coding required for handling the SHFILEOPSTRUCT structure.
The SHFileOperation deletes files and subdirectories inside the target directory recursively.
The file deletion process aborts whenever it encounters an undeletable object. The call returns an error code (for example 32, File Sharing Violation). The files and subdirectories following the file in question do not get deleted in this take.
* * *
.NET has more than one way for deleting a directory.
System.IO Directory.Delete throws an exception when the path is not an empty directory.
While System.IO DirectoryInfo.Delete can delete files and directories recursively.
Credits: PHP (4.4.9), an HTML-embedded scripting language,
MySQL (5.1.55-log), the Open Source standard SQL database,
AceHTML Freeware
Version 4, freeware HTML Editor of choice. Hosted by Korax Online Inc.