Home > Net >  C # call exe
C # call exe

Time:10-21

I wrote a script in python, packaged into an exe file, want to through the c # to call the exe, output parameter is an array, a lot of online tutorials are introduced into a string, to the incoming array should be how to deal with?

CodePudding user response:

We call this I never mind

How to receive, this depends on your python exe

So I ask, you run the exe in CMD, what are you going to enter the parameter

Exe is XXXX. 1, 2, 3, 4, 5

CodePudding user response:

To see your input and output part of a python program

CodePudding user response:

My python it plans to use the sym. Argv [1] to receive parameters, the input parameters are I generated a adjacency matrix in c #

CodePudding user response:

Fill in the parameters 1, 2, 3 like this

CodePudding user response:

First, regardless of parameter, first tell me about what is the mode of communication between processes

CodePudding user response:

Process understanding once,,,,,,,,,,,,,,,,,, use the command line first call is successful, will understand how to write,
Process Process=new Process ();
Process. StartInfo. The Arguments=... ;
Process. StartInfo. UseShellExecute=false;
Process. StartInfo. CreateNoWindow=true;
Process. StartInfo. FileName="XXXX. Exe";
Process. StartInfo. RedirectStandardInput=true;
Process. StartInfo. RedirectStandardOutput=true;
Process. StartInfo. RedirectStandardError=true;
Process. The Start ();
The return process. StandardOutput. ReadToEnd ();//return the result
  •  Tags:  
  • C#
  • Related