private static bool DeleteFile(string[] path, FileOperationFlags flags) {
if (path == null || path.All(x => x == null)) return false;
try {
var fs = new SHFILEOPSTRUCT {
wFunc = FileOperationType.FO_DELETE,
pFrom = string.Join("\0", path.Where(x => x != null)) + "\0\0",
fFlags = flags
};
SHFileOperation(ref fs);
return true;
} catch (Exception) {
return false;
}
}