资 源 简 介
C# 清空回收站,这个功能不用多介绍了吧,你懂的,具体的实现请看以下代码:
const int SHERB_NOCONFIRMATION = 0x000001;//整型常量在API中表示删除时没有确认对话框
const int SHERB_NOPROGRESSUI = 0x000002;//在API中表示不显示删除进度条
const int SHERB_NOSOUND = 0x000004;//在API中表示删除完毕时不播放声音
[DllImportAttribute("shell32.dll")]//声明API函数
private static extern int SHEmptyRecycleBin(IntPtr handle, string root, int falgs);
private void button1_Click(object sender, EventArgs e)
{
//清空回收站
SHEmptyRecycleBin(this.Handle, "", SHERB_NOCONFIRMATION + SHERB_NOPROGRESSUI + SHERB_NOSOUND);
}