I am saving some csv files using threads, Threads are created in a loop Here is the code
foreach (var f in Files)
{
string tFile = f.ToString();
Thread myThread = new Thread(() => SaveCSVFile(BulkExtractFolder, tFile));
myThread.Start();
}
//save folder as zip file and download it
it starts saving csv files but when the zip file downloads it does not contain all files in it, because some threads are in execution when I zip this folder, How I can know that all threads started in for loop have completed their execution.