/// <summary>
/// 根据路径删除文件
/// </summary>
/// <param name="path"></param>
public void DeleteFile(string path)
{
FileAttributes attr = File.GetAttributes(path);
if (attr == FileAttributes.Directory)
{
Directory.Delete(path,true);
}
else
{
File.Delete(path);
}
}
删除文件夹或者文件
最新推荐文章于 2024-03-19 10:59:30 发布