private void mergeFolder(string src, string des)
{
DirectoryInfo diSrc = new DirectoryInfo(src);
if(!diSrc.Exists ||(diSrc.GetDirectories().Length ==0 &&diSrc.GetFiles().Length ==0)||src ==des)
return;
DirectoryInfo diDes = new DirectoryInfo(des);
if(!diDes.Exists)
diDes.Create();
foreach (FileInfo fi in diSrc.GetFiles())
{
fi.CopyTo(Path.Combine(diDes.FullName,fi.Name),true);
}
foreach(DirectoryInfo di in diSrc.GetDirectories())
{
mergeFolder(di.FullName, Path.Combine(diDes.FullName, di.Name));
}
}