Calling exe program in c #
3 answers
using System.Diagnostics;
string command = @"C:\tmp\myExe.exe -my -params";
ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + command)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (Process proc = new Process())
{
proc.StartInfo = procStartInfo;
proc.Start();
return proc.StandardOutput.ReadToEnd();
}
+3
a source to share
If you want to generate a C # file before executing it, you can use CSharpCodeProvider to compile the C # file and then use the process class to execute the output file.
You can find examples of each of the links provided.
0
a source to share