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 KumarPosted Apr 14, 2016, 1:31 AM
yashu vPosted Apr 14, 2016, 2:43 AM
Amit KumarPosted Apr 14, 2016, 2:37 AM
yashu vPosted Apr 14, 2016, 2:08 AM
Amit KumarPosted Apr 14, 2016, 2:04 AM
yashu vPosted Apr 14, 2016, 1:34 AM
yashu vPosted Apr 14, 2016, 12:37 AM
Vivek KumarPosted Apr 12, 2016, 11:25 AM
Rahul ChavanPosted Apr 12, 2016, 7:51 AM