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