要实现清空回收站怎么写代码啊,,,
DriveInfo[] di = DriveInfo.GetDrives();
foreach (DriveInfo item in di)
{
if (item.IsReady)
{
if (Directory.Exists(item.ToString()+"Recycled"))
{
//MessageBox.Show(item.ToString());
Directory.Delete(item.ToString() + "Recycled", true);
}
}
}
我这么写试了一下,只可以清空c盘删除的内容,求解啊
DriveInfo[] di = DriveInfo.GetDrives();
foreach (DriveInfo item in di)
{
if (item.IsReady)
{
if (Directory.Exists(item.ToString()+"Recycled"))
{
//MessageBox.Show(item.ToString());
Directory.Delete(item.ToString() + "Recycled", true);
}
}
}
我这么写试了一下,只可以清空c盘删除的内容,求解啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货