how can i copy the contents of one folder to other, and other as create a folder like this format
AutomatedBuild_12_04_2016_14_30
string sourcePath = @"D:\StarTeam\CMP\Coding\AutomatedBuild";
string targetPath = @"D:\StarTeam\CMP\Coding\AutoBuildArtifacts\AutomatedBuildBackups";
if (!Directory.Exists(targetPath))
{
Directory.CreateDirectory(AutomatedBuild.DateNow());
}
foreach (var srcPath in Directory.GetFiles(sourcePath))
{
//Copy the file from sourcepath and place into mentioned target
path,
//Overwrite the file if same file is exist in target path
File.Copy(srcPath, srcPath.Replace(sourcePath, targetPath),
true);
}

Amit KumarRank #459 · 5.4K reputationPosted Apr 13, 2016, 9:31 PM EDT
Rahul ChavanRank #2,671 · 521 reputationPosted Apr 12, 2016, 3:51 AM EDT
Vivek KumarRank #272 · 9.3K reputationPosted Apr 12, 2016, 7:25 AM EDT
yashu v94 reputationPosted Apr 13, 2016, 8:37 PM EDT
yashu v94 reputationPosted Apr 13, 2016, 9:34 PM EDT
Amit KumarRank #459 · 5.4K reputationPosted Apr 13, 2016, 10:04 PM EDT
yashu v94 reputationPosted Apr 13, 2016, 10:08 PM EDT
Amit KumarRank #459 · 5.4K reputationPosted Apr 13, 2016, 10:37 PM EDT
yashu v94 reputationPosted Apr 13, 2016, 10:43 PM EDT