C# Class Zazzles.ProcessHandler

显示文件 Open project: FOGProject/zazzles Class Usage Examples

Public Methods

Method Description
CreateImpersonatedClientEXE ( string filePath, string param, string user ) : Process

Create an process as another user. The process will not be run automatically. This can only be done on unix systems.

Kill ( string name ) : void

Kill the first instance of a process

KillAll ( string name ) : void

Kill all instances of a process

KillAllEXE ( string name ) : void

Kill all instances of an EXE

KillEXE ( string name ) : void

Kill the first instance of an EXE

Run ( string filePath, string param, bool wait = true, bool log = true ) : int

Run a process

Run ( string filePath, string param, bool wait, string &stdout, bool log = true ) : int

Run a process

RunClientEXE ( string file, string param, bool wait = true, bool log = true ) : int

Run an EXE located in the client's directory

RunClientEXE ( string file, string param, bool wait, string &stdout, bool log = true ) : int

Run an EXE located in the client's directory

RunEXE ( string filePath, string param, bool wait = true, bool log = true ) : int

Run an EXE

RunEXE ( string filePath, string param, bool wait, string &stdout, bool log = true ) : int

Run an EXE

Private Methods

Method Description
SplitOutput ( string output ) : string[]

Method Details

CreateImpersonatedClientEXE() public static method

Create an process as another user. The process will not be run automatically. This can only be done on unix systems.
public static CreateImpersonatedClientEXE ( string filePath, string param, string user ) : Process
filePath string The path of the executable to run
param string Parameters to run the process with
user string The user to impersonate
return System.Diagnostics.Process

Kill() public static method

Kill the first instance of a process
public static Kill ( string name ) : void
name string The name of the process
return void

KillAll() public static method

Kill all instances of a process
public static KillAll ( string name ) : void
name string The name of the process
return void

KillAllEXE() public static method

Kill all instances of an EXE
public static KillAllEXE ( string name ) : void
name string The name of the process
return void

KillEXE() public static method

Kill the first instance of an EXE
public static KillEXE ( string name ) : void
name string The name of the EXE
return void

Run() public static method

Run a process
public static Run ( string filePath, string param, bool wait = true, bool log = true ) : int
filePath string The path of the executable to run
param string Parameters to run the process with
wait bool Wait for the process to exit
log bool Log errors
return int

Run() public static method

Run a process
public static Run ( string filePath, string param, bool wait, string &stdout, bool log = true ) : int
filePath string The path of the executable to run
param string Parameters to run the process with
wait bool Wait for the process to exit
stdout string An array to place stdout, split by lines
log bool Log errors
return int

RunClientEXE() public static method

Run an EXE located in the client's directory
public static RunClientEXE ( string file, string param, bool wait = true, bool log = true ) : int
file string The name of the EXE to run
param string Parameters to run the EXE with
wait bool Wait for the process to exit
log bool Log errors
return int

RunClientEXE() public static method

Run an EXE located in the client's directory
public static RunClientEXE ( string file, string param, bool wait, string &stdout, bool log = true ) : int
file string The name of the EXE to run
param string Parameters to run the EXE with
wait bool Wait for the process to exit
stdout string An array to place stdout, split by lines
log bool Log errors
return int

RunEXE() public static method

Run an EXE
public static RunEXE ( string filePath, string param, bool wait = true, bool log = true ) : int
filePath string The path of the EXE to run
param string Parameters to run the EXE with
wait bool Wait for the process to exit
log bool Log errors
return int

RunEXE() public static method

Run an EXE
public static RunEXE ( string filePath, string param, bool wait, string &stdout, bool log = true ) : int
filePath string The path of the EXE to run
param string Parameters to run the EXE with
wait bool Wait for the process to exit
stdout string An array to place stdout, split by lines
log bool Log errors
return int