private void UpdateYouDl() { var link = (string)Settings.Default["pathToYoudl"]; if (string.IsNullOrEmpty(YouPath)) { YouPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), link.Split('/').Last()); } if (SiteHelper.CheckForInternetConnection(link)) { IsUpdateButtonEnable = false; YouHeader = "Youtube-dl (update in progress..)"; using (var client = new WebClient()) { client.DownloadProgressChanged += ClientDownloadProgressChanged; client.DownloadFileCompleted += ClientDownloadFileCompleted; client.DownloadFileAsync(new Uri(link), YouPath); } } else { MessageBox.Show(link + " is not available"); } }