i made downloader app to download mp3 and mp4 files from like online BUT files aren't downloading nor showing help please. but it's not seem to working. please help {urgent}

_ ati 111 Reputation points
2022-09-24T18:42:48.167+00:00

please help i don't know what's the issue.

it's saying in executing that the statements are empty, i don't know what's the problem. help please

private async void button1_Click(object sender, EventArgs e)

     {  
         using (FolderBrowserDialog fbd1 = new FolderBrowserDialog() { Description = "Please select a folder where you want to download the file" }) ;  
         {  
             FolderBrowserDialog fbd1 = new FolderBrowserDialog();  
             if (fbd1.ShowDialog()==DialogResult.OK)  
             {  
                 MessageBox.Show("Download Started!");  

                 var yt = YouTube.Default;  
                 var video = await yt.GetVideoAsync(textBox1.Text);  
                 File.WriteAllBytes(fbd1.SelectedPath + @"\" + video.FullName, await video.GetBytesAsync());  
                 var inputfile = new MediaToolkit.Model.MediaFile { Filename = fbd1.SelectedPath + @"\" + video.FullName };  
                 var outputfile = new MediaToolkit.Model.MediaFile { Filename = $"{fbd1.SelectedPath + @"\" + video.FullName }.mp3"  };  

                 using (var enging = new Engine())  
                 {  
                     enging.GetMetadata(inputfile);  
                     enging.Convert(inputfile, outputfile);  
                 }  
                 if (format == true)  
                 {  
                     File.Delete(fbd1.SelectedPath + @"\" + video.FullName);  
                 }  
                 else  
                 {  
                     File.Delete($"{fbd1.SelectedPath + @"\" + video.FullName}.mp3");  
                 }  
                 progressBar1.Value = 100;  
                 MessageBox.Show("Download Completed!");  
             }  
             else  
             {  
                 MessageBox.Show("Please select a folder");  
             }  
         }  



     }  



     private void radioButton1_CheckedChanged(object sender, EventArgs e)  
     {  
         format = true;  
     }  




     private void mp4checked(object sender, EventArgs e)  
     {  
         format = false;  
     }  
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,676 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,277 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
766 questions
{count} votes