private void VersionManager_Load(object sender, EventArgs e) { this.Owner = Program.GMS; Directory.CreateDirectory(@"versions"); for (int cdnIndex = 1; cdnIndex <= NUMBER_OF_CDN_URLS; cdnIndex++) { Thread downloadThread = new Thread(() => { CDN.UseCDN(CDNUrls.FromIndex(cdnIndex)); }); downloadThread.Start(); while (downloadThread.IsAlive) { Application.DoEvents(); } foreach (String Version in CDN.GetVersions("ps4")) { if (Version != "1.4.9999" || DownloadList.Items.Contains(Version)) { DownloadList.Items.Add(Version); } } } foreach (String dir in Directory.GetDirectories(@"versions")) { DownloadedList.Items.Add(Path.GetFileName(dir)); DownloadList.Items.Remove(Path.GetFileName(dir)); } }