最近工作中需要大批量将文件中的名字录入到Excel
借用写程序减少重复的人工..特此分享
///
/// 点击事件激活选择文件夹
///
///
///
private void btnselect_Click(object sender, EventArgs e)
{
// FbdV.RootFolder = “d:\”;
FbdV.SelectedPath = “d:\”;//起始默认穆勒
// System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
//dialog.Description = “请选择Txt所在文件夹”;
FbdV.Description = “请选择需要遍历的文件夹图片”;
if (FbdV.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (string.IsNullOrEmpty(FbdV.SelectedPath))
{
MessageBox.Show(this, “文件夹路径不能为空”, “提示”);
return;
}
this.label1.Text = “处理中…”;
tbxPath.Text = FbdV.SelectedPath.Trim();
//this.LoadingDisplay = true;
// Action a = DaoRuData;
// a.BeginInvoke(FbdV.SelectedPath, asyncCallback, a);
try
{
ScanPic(FbdV.SelectedPath.Trim());<
C#获取目录及子目录文件名,文件流写入txt
最新推荐文章于 2024-06-04 11:08:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)