I have this code to start a command line app:
private void LaunchCommandLineApp(string latestStudents, string latestTopics)
{
// Use ProcessStartInfo class
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "ConsoleApplication2.exe";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments =
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
}
}
catch
{
// Log error.
}
}
What is the correct syntax for passing latestStudents & latestTopics at the line startInfo.Arguments =
as arguments? I've tried everything I can think of and some but I still don't get it!