public static bool EmptyRecycleBin(RecycleFlag flags = 0) { try { int result = NativeMethods.SHEmptyRecycleBin(IntPtr.Zero, null, flags); return(result == 0); } catch (Exception) { return(false); } }
static extern int SHEmptyRecycleBin(IntPtr hwnd, string pszRootPath, RecycleFlag dwFlags);
private static extern int SHEmptyRecycleBin(System.IntPtr hwnd, string pszRootPath, RecycleFlag dwFlags);