时间:2020-11-15 13:32:38 | 栏目:.NET代码 | 点击:次
代码:
static void Main(string[] args)
{
Console.WriteLine("删除文件到回收站");
string filepath = "leaver.txt";
FileSystem.DeleteFile(filepath, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
Console.WriteLine("删除文件完成");//keleyi.com
Console.WriteLine("删除文件夹到回收站");
string dirpath = "leaver";
FileSystem.DeleteDirectory(dirpath, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
Console.WriteLine("删除文件夹完成");
}
}
}