static void DeleteFile(ColumbiaFile file) { string name = String.Format("{0}\\{1}{2}", tempDirectory, file.Name, cipher.Decrypt(archiveExtension)); if (File.Exists(name)) { File.Delete(name); } }
static bool ExtractFile(ColumbiaFile file) { string name = String.Format("{0}\\{1}{2}", tempDirectory, file.Name, cipher.Decrypt(archiveExtension)); if (!File.Exists(name)) { return(false); } if (File.Exists(file.Name)) { File.Delete(file.Name); } ZipFile.ExtractToDirectory(name, ".\\"); return(HashFile.GetMD5(file.Name) == file.Hash); }
static void DownloadFile(ColumbiaFile file) { string link = "NnLZSIYBSB42EgVIX2MXed30BXSSquhuO1OBzLEDIiErmKfp/dbfdoEmKtvOUpujK4NQg+47/SpeLX+cg8Ac9UppPrA9GBMr8z4tZwRJ6seivmnq+GaYlwkJw7d7JlSkjKqkbjGrzEpQ6X96u+FtiQIdFwFrwfHRT7+jqU//9Mw="; //https://columbia-state.com/launcher/files/ using (WebClient client = new WebClient()) { var url = new Uri(cipher.Decrypt(link) + file.Name + cipher.Decrypt(archiveExtension)); client.DownloadFile(url, tempDirectory + "\\" + file.Name + cipher.Decrypt(archiveExtension)); //client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged); //client.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted); //client.DownloadFileAsync(url, path + "\\" + lib.Name(i).Substring(2) + ".gz"); //client.DownloadFile(url, path + "\\" + lib.Name(i).Substring(2) + ".gz"); //while (client.IsBusy) Thread.Sleep(100); } }