using ModernWpf.Controls; using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Security.Cryptography; using System.Threading.Tasks; using System.Windows.Forms; namespace EZPPClient_Installer { public class DownloadUtil { public static List FilesToDownload(string pathToEZPP) { bool directoryExists = Directory.Exists(pathToEZPP); List downloadList = new List(); List md5Files = new List(); try { using (WebClient wc = new WebClient()) { var data = wc.DownloadString("https://ez-pp.farm/static/client/client.data"); string[] dataList = data.Split('\n'); foreach (string datastring in dataList) { if (string.IsNullOrWhiteSpace(datastring)) continue; string[] se = datastring.Split('#'); string md5 = se[0]; string name = se[1]; md5Files.Add(new MD5File(name, md5)); } } }catch(WebException error) { new ContentDialog() { Title = "Oops...", Content = "A error occurred while trying to fetch all needed Files.\n" + error.Message, PrimaryButtonText = "Okay" }.ShowAsync(); } if (!directoryExists) { foreach (MD5File md5File in md5Files) downloadList.Add(md5File.getName()); } else { } return downloadList; } public async Task CheckForUpdate() { return false; } } }