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

if (Directory.Exists(path))
{

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


相关文章:

  • 2021-11-05
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
  • 2021-10-22
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2021-09-14
相关资源
相似解决方案