Empty recycle bin
Posted: Mon Mar 25, 2013 2:59 am
hey guys
with this snippet you can clear your recycle bin
enjoy
original source - http://ultimateprogrammingtutorials.blo ... ing-c.html
with this snippet you can clear your recycle bin
Code: Select all
i am using button click event here by the way place the enum reclyflags lines after the
enum RecycleFlags : uint
{
SHERB_NOCONFIRMATION = 0x00000001,
SHERB_NOPROGRESSUI = 0x00000001,
SHERB_NOSOUND = 0x00000004
}
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
static extern uint SHEmptyRecycleBin(IntPtr hwnd, string pszRootPath,
RecycleFlags dwFlags);
private void button1_Click(object sender, EventArgs e)
{
uint result = SHEmptyRecycleBin(IntPtr.Zero, null, 0);
}
Code: Select all
also you need the namespace InitializeComponent();
}
Code: Select all
download sampleusing System.Runtime.InteropServices;
enjoy
original source - http://ultimateprogrammingtutorials.blo ... ing-c.html