public void RunDownloadSync() { List <string> websites = Ultility.PrepData(); foreach (var site in websites) { WebsiteDataModel result = Ultility.DownloadWebsite(site); result.Report(); } }
public string RunDownloadSync() { List <string> websites = Ultility.PrepData(); foreach (var site in websites) { WebsiteDataModel result = Ultility.DownloadWebsite(site); result.Report(); } return($"RunDownloadSync - Done - Thread {Thread.CurrentThread.ManagedThreadId}"); }
public string RunDownload() { List <string> websites = Ultility.PrepData(); foreach (var site in websites) { WebsiteDataModel result = new WebsiteDataModel(); Thread thread = new Thread(() => { result = Ultility.DownloadWebsite(site); }); thread.Start(); //thread.Join(); result.Report(); } return($"RunDownloadSync - Done - Thread {Thread.CurrentThread.ManagedThreadId}"); }