Hi,
I have to copy some .txt files in to a different location.But the issue is i am unable to paste those files due to same name.I am getting those .txt files from different folder.I need to append a number to make .txt file unique and paste in to different location.My current code doesnt allow this.How can i do this?
C#
foreach (var file in Directory.EnumerateFiles(extractPathForCurrentZip, "*.txt"))
{
File.Copy(file, DestinationFoldername+ Path.GetFileName(file));
}
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Apr 19, 2022, 3:41 AM EDT