string path=Server.MapPath("/cp_view");
 //是否存在指定文件夹

if (Directory.Exists(path))
{

//遍历所有的文件,并且删除
foreach (string d in Directory.GetFileSystemEntries(path))
{
if (File.Exists(d))
{
File.Delete(d);
}
}
}


相关文章: