In the process of server development, we often need to open a number of black-box testing, in the folder to find these executables is a waste of time to
bring the personal experience is also very bad, we can use C # to make some gadgets to improve this situation, such as the need to open a number of black boxes
Executable file dropped in the button, although the function is very simple, but bring personal experience is moving, C # Grammar is not introduced, I here
mainly about how to invoke the executable file
The required header file
using System.Diagnostics;
Here is the folder directory
string TargetPath = string of the executable file to invoke. Format (@ "folder path");
Process: Provides access to local and remote processes and enables you to start and stop Local system processes process processing
= new process ();
Initializes some of the underlying information process for an executable file
. Startinfo.workingdirectory = TargetPath; Initializes the folder information process for the executable file
. Startinfo.filename = "executable file name. suffix"; Initialize executable file name
//When we need to pass parameters to an executable file we can set this parameter
///"PARA1 para2 para3" parameter as a string, with each parameter separating the process by a space
. startinfo.arguments = "Para1 para2 para3";
Process. Startinfo.useshellexecute = true; Start the executable process by using the operating system shell startup processes
. Start ();
With the above code, we can invoke any executable file.
I personally like the various server startup information and database information integration in the gadget, each time to test the time
to click a few buttons can be, to avoid always go to the folder to find the necessary startup files.