The code is very simple, so you don't need to explain it. You can directly copy the code.
For more sample Code, visit microsoft sample Code (Samples from microsoft) All-In-One Code: <A href =
"http://1code.codeplex.com"
>http://1code.codeplex.com</A>
<PRE
class
=brush:csharp;gutter:
false
;><DIV
class
=cnblogs_Highlighter><PRE
class
=brush:csharp;gutter:
false
;>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.IO;
namespace
ZipOneCode.FileProvider
{
public
class
FileHelper
{
/// <summary>
/// Copy the folder (and all subfolders and files under the folder)
/// </summary>
/// <Param name = "sourcePath"> path of the folder to be copied </param>
/// <Param name = "destinationPath"> target path </param>
public
static
void
CopyDirectory(String sourcePath, String destinationPath)
{
DirectoryInfo info =
new
DirectoryInfo(sourcePath);
Directory.CreateDirectory(destinationPath);
foreach
(FileSystemInfo fsi
in
info.GetFileSystemInfos())
{
String destName = Path.Combine(destinationPath, fsi.Name);
if
(fsi
is
System.IO.FileInfo) &n