C删除指定目录空文件夹(源码)

C删除指定目录空文件夹(源码)Lete 乐特自制删除指定目录空文件夹工具 C NET Framework4 5 卸载软件的时候有些软件只删除程序 并不删除文件夹 以前不会编程 网上找教程大部分都是 bat 文件的教程 放到想要删除的目录下运行 但这只能删除这个目录下的空目录 不能删除这个目录下空目录的子目录 为了方便自己就动手写了一个 Main cs using System using

大家好,我是讯享网,很高兴认识大家。

Lete乐特自制删除指定目录空文件夹工具(C# - .NET Framework4.5)

卸载软件的时候有些软件只删除程序,并不删除文件夹
以前不会编程,网上找教程大部分都是bat文件的教程
(放到想要删除的目录下运行,但这只能删除这个目录下的空目录,不能删除这个目录下空目录的子目录)
为了方便自己就动手写了一个

JblHTP.gif

Main.cs

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Delete { 
    public partial class Main : Form { 
    public Main() { 
    InitializeComponent(); } // 浏览 private void btnLL_Click(object sender, EventArgs e) { 
    FolderBrowserDialog f = new FolderBrowserDialog(); if (f.ShowDialog() == DialogResult.OK) { 
    String DirPath = f.SelectedPath; this.txtPath.Text = DirPath;//G:\新建文件夹 } } // 开始 private void btnDelete_Click(object sender, EventArgs e) { 
    // 获取路径 string str = txtPath.Text; str.
讯享网
小讯
上一篇 2025-01-18 18:04
下一篇 2025-02-28 07:02

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/75527.html