I have the below code and it is not executing, can I have some input on what is wrong with it?
Error is: You must provide at least one URL. https://prnt.sc/Alvh7tcO0bsp
string commandarg = "-f " + textBox1.Text.Trim();
ProcessStartInfo processInfo = new ProcessStartInfo
{
FileName = ConfigurationSettings.AppSettings["youtubedlpath"].ToString(),
Arguments = commandarg,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = false
};
using (Process process = new Process { StartInfo = processInfo })
{
process.Start();
// Synchronously read the standard output of the spawned process.
StreamReader reader = process.StandardOutput;
string output = reader.ReadToEnd();
// Write the redirected output to this application's window.
Console.WriteLine(output);
process.WaitForExit();
if (!process.HasExited)
{
process.Kill();
}
}
Console.WriteLine("nnPress any key to exit.");
Console.ReadLine();