How can I pass multiple arguments to a newly created process in C#?
Also which class (Process or ProcessStartInfo or MyProcess) in should I use in executing a program, with the condition of passing multiple arguments to the newly created/executed process?
As开发者_如何学C is I have the equivalent (Borland) C++ code for the same task, which is as follows:
spawnv(P_NOWAITO,Registry->ReadString("Downloader").c_str(),arglist);
where arglist is a char pointer array and
Registry->ReadString("Downloader").c_str(), is the program to execute.
In order to pass multiple command line arguments you should separate each with a space and surround it in quotes in case the argument itself contains a space.
string[] args = { "first", "second", "\"third arg\"" };
Process.Start("blah.exe", String.Join(" ", args));
Process.Start( "program.exe", "arg1 arg2 arg3" );
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论