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