简体   繁体   中英

Calling ClearCanvas exe with arguments from c# windows application

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?

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM