如何在列表视图中获取所有垃圾文件并使用c#.net删除所有文件 [英] how to get all junk file in list view and delete all the files using c#.net
本文介绍了如何在列表视图中获取所有垃圾文件并使用c#.net删除所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在列表视图中获取所有垃圾文件并删除c#.net中的所有文件
i创建一个带有列表视图的表单现在我想获取该列表视图中的所有垃圾文件然后删除它们
how to get all junk files in the list view and delete all the files in c#.net
i create one form with list view now i wanted to get all the junk files in that listview and then delete them
推荐答案
尝试使用此代码示例在列表视图中显示临时文件
try this code sample to dispaly temp file in listview
private void Form3_Load(object sender, EventArgs e)
{
DirectoryInfo Dir = new DirectoryInfo(System.IO.Path.GetTempPath());
FileInfo[] Files = Dir.GetFiles();
foreach (FileInfo file in Files)
{
listView1.Items.Add(file.Name);
}
}
这篇关于如何在列表视图中获取所有垃圾文件并使用c#.net删除所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文