0

I am trying to call the ClearCanvas exe with aruments from Windows application using C#, but I am not able to call it. Below is my code..

string[] args = new string[2]; args[0] = "ClearCanvas.Desktop";

        Process pro = new Process();

        pro.StartInfo.FileName = @"D:\ClearCanvasWorkStation\Desktop\Executable\bin\Debug\ClearCanvas.Desktop.Executable.exe";
        pro.StartInfo.Arguments = args[0];

        pro.Start();

What am I supposed to send as an argument and what I need to do if I want to send more than one argument?

  • BTW, "am not able to call it" is not very detailed explanation what did not work - i.e. it missing expected behavior and possible error messages. – Alexei Levenkov Dec 11 '12 at 07:26

1 Answers1

0

Arguments is a string that contains command line arguments as if you typed them in command line.

 Process process = new Process();
 process.StartInfo.FileName = 
    @"D:\Cle...Debug\ClearCanvas.Desktop.Executable.exe";
 process.StartInfo.Arguments = "paramet1 parameter2 \"param with space\" parameter4";
 process.Start();

Since it is your custom application I don't know what your application expects...

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179