C#关于文件夹遍历以及文件拷贝

本文详细介绍了使用C#编程语言如何遍历文件夹结构,并实现高效安全的文件复制操作,适用于需要在C#项目中进行文件管理的开发者。
摘要由CSDN通过智能技术生成

C#关于文件夹遍历以及文件拷贝

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 FrmSearchXmlAndCopy
{
   
    public partial class Form1 : Form
    {
   
        public Form1()
        {
   
            InitializeComponent();
        }

        private void btnsearch_Click(object sender, EventArgs e)
        {
   

            string timepath = DateTime.Now.ToString("yyyyMMdd");

            string strSNnumber = this.txtSN.Text.Trim();

            string parentPath = this.textPatent.Text.Trim();
            string outPath = this.textOut.Text.Trim();

            


            string filepath = parentPath + "\\" + timepath;
            DirectoryInfo folder = new DirectoryInfo
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值