1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// using System.Runtime.InteropServices;
[DllImport("shell32.dll")]
static extern int SHEmptyRecycleBin(IntPtr hWnd, string pszRootPath, uint dwFlags);
public static void EmptyRecycleBin(string rootPath, bool showConfirmation, bool showProgressbar, bool playSound)
{
uint Flags = 0;
if (!showConfirmation)
Flags |= 1;
if (!showProgressbar)
Flags |= 2;
if (!playSound)
Flags |= 4;
SHEmptyRecycleBin(IntPtr.Zero, rootPath, Flags);
}
|