I have a problem, i am trying to write a program that will copy a file with the same name from A to B and i want to change the exension from bk2 to bk3,4,5,6,7 or just rename the filename so the program can copy the file even if the same name allready exist.
I am very beginner in C# everything is dificult now.
Below the code
enter code here
static void Main(string[] args)
{
//path of file
string pathToOriginalFile = @"D:\C#\LOGS_PROG\SystemLog.bk2";
string extension = ".bk2";
//duplicate file path
string PathForDuplicateFile = @"D:\C#\Backup\Systemlog";
//provide source and destination file paths
File.Copy(pathToOriginalFile, PathForDuplicateFile + extension);
}
}