标签:io ar for sp 文件 on cti bs new
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace qidi
{
class Program
{
static void Main(string[] args)
{
CopyFolder(@"F:\C#",@"F:\dddd");
}
static void CopyFolder(string sPath, string dPath)
{
if (!Directory.Exists(dPath))
{
Directory.CreateDirectory(dPath);
DirectoryInfo sDir = new DirectoryInfo(sPath);
FileInfo[] fileArray = sDir.GetFiles();
foreach (FileInfo file in fileArray)
{
file.CopyTo(dPath + "\\" + file.Name, true);
}
DirectoryInfo[] subDirArray = sDir.GetDirectories();
foreach (DirectoryInfo subDir in subDirArray)
{
CopyFolder(subDir.FullName, dPath + "//" + subDir.Name);
}
}
}
}
}
标签:io ar for sp 文件 on cti bs new
原文地址:http://www.cnblogs.com/lizhifeng/p/4056280.html