回收站文件的处理

lsj_zrp 2008-04-22 05:49:16
string[] strDirectory = Directory.GetDirectories("C:\\RECYCLER");
for (int i = 0; i < strDirectory.Length; i++)
{
string[] strFiles = Directory.GetFiles(strDirectory[i].ToString());

if (strFiles.Length>0) //判断是否存在文件
{;
if (MessageBox.Show("是否确定?", "垃圾处理!", MessageBoxButtons.YesNo, MessageBoxIcon.Question)==DialogResult.Yes )
{
foreach (string str in strFiles)
{
MessageBox.Show(str);
}
}
}
}
为什么只能找到回收站里面两个隐藏的文件"desktop.ini"和"INFO2"文件,而我删除到回收站的文件却不能找到?
...全文
98 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
brbrm 2008-04-22
  • 打赏
  • 举报
回复
要遍历所有驱动器的话,用System.IO.DriveInfo.GetDrives();
brbrm 2008-04-22
  • 打赏
  • 举报
回复
删的是哪个盘上的文件,就到哪个盘的RECYCLER子目录下去找
luntanyonghu 2008-04-22
  • 打赏
  • 举报
回复
Directory.GetDirectories("C:\\RECYCLER");
这句有问题

110,561

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧