Hi Guys I was wondering if anyone could assist me by telling me / correcting my code as to where I am going wrong.
I'm trying to simply excute flvmeta.exe, and pass the parameters:
"flvmeta input.flv output.flv"
when I do this manually it works fine, however when I build and try and run this .exe it does not run the: "flvmeta input.flv output.flv" I know that it is finding the flvmeta.exe, however for some reason there is an issue with my startInfo.Arguments. Could someone please help me out, I'm loosing my hair.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
class Program
{
static void Main()
{
LaunchCommandLineApp();
}
/// <summary>
/// Launch the legacy application with some options set.
/// </summary>
static void LaunchCommandLineApp()
{
// For the example
const string inputFLV = "input.flv";
const string outputFLV = "output.flv";
// Use ProcessStartInfo class
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "flvmeta.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "flvmeta " + inputFLV + " " + outputFLV + "";
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
Console.Write(startInfo.Arguments);
exeProcess.WaitForExit();
}
}
catch
{
// Log error.
}
}
}