My code:
List<string> fileList = Directory.GetFiles(path).ToList();
foreach (string file in fileList)
{
File.Copy(file, biosAllDir + @"\" + Path.GetFileName(file), true);
string fileWithoutPath = Path.GetFileName(file);
outputTextbox.Text = $"Copied: {fileWithoutPath}" + Environment.Newline;
}
This foreach loop copies all the files in the list fine but when it comes to adding text to the outputTextbox it just adds one line (the last one) and not any other, do you know why?
Thanks