views:

97

answers:

0

Hello, I have a C# WinForms app that I use to create software patches for my app.

In noticed that Babel .Net includes Babel.Build.dll and Babel.Code.dll

Is there a way, in my C# code, I can call Babel .Net

something like:

ExecuteCommand(C:\Program Files\Babel\babel.exe "C:\Patch\v6\Demo\Bin\Lib.dll" --rules "C:\Patch\babelRules.xml", 600)

Here's a common script to execute a CMD prompt in C#. However if I just include the Babel.Build.dll in my winform I may be able to do it seamlessly.

public static int ExecuteCommand(string Command, int Timeout)
{
   int ExitCode;
   ProcessStartInfo ProcessInfo;
   Process Process;

   ProcessInfo = new ProcessStartInfo("cmd.exe", "/C " + Command);
   ProcessInfo.CreateNoWindow = true; 
   ProcessInfo.UseShellExecute = false;
   Process = Process.Start(ProcessInfo);
   Process.WaitForExit(Timeout);
   ExitCode = Process.ExitCode;
   Process.Close();

   return ExitCode;
}