C# Класс System.Diagnostics.Process

Наследование: System.ComponentModel.Component
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
BootTimeToDateTime System.DateTime
BuildCommandLine StringBuilder
CloseCore void
CloseMainWindowCore bool
ConfigureAfterProcessIdSet void
CreateEnvp string[]
CreatePipe void
CreatePipeWithSecurityAttributes void
EnsureHandleCountPopulated void
EnvironmentVariablesToByteArray byte[]
GetCurrentProcessId int
GetCurrentProcessRUsage Interop.libproc.rusage_info_v3
GetEncoding System.Text.Encoding
GetExePath string
GetMainWindowTitle string
GetProcessHandle Microsoft.Win32.SafeHandles.SafeProcessHandle
GetProcessHandle Microsoft.Win32.SafeHandles.SafeProcessHandle
GetProcessHandle Microsoft.Win32.SafeHandles.SafeProcessHandle
GetProcessTimes System.Diagnostics.ProcessThreadTimes
GetStat Interop.procfs.ParsedStat
GetWaitState System.Diagnostics.ProcessWaitState
GetWorkingSetLimits void
IsRespondingCore bool
OpenStream System.IO.FileStream
ParseArgumentsIntoList void
ParseArgv string[]
RefreshCore void
ResolvePath string
SetPrivilege void
SetWorkingSetLimitsCore void
Start Process
Start Process
Start System.Diagnostics.Process
Start System.Diagnostics.Process
StartCore bool
TicksToTimeSpan System.TimeSpan
UpdateHasExited void
WaitForExitCore bool
WaitForInputIdleCore bool

Открытые методы

Метод Описание
BeginErrorReadLine ( ) : void
BeginOutputReadLine ( ) : void
CancelErrorRead ( ) : void
CancelOutputRead ( ) : void
Close ( ) : void
CloseMainWindow ( ) : bool
EnterDebugMode ( ) : void

Puts a Process component in state to interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread.

GetCurrentProcess ( ) : System.Diagnostics.Process
GetProcessById ( int processId ) : System.Diagnostics.Process
GetProcessById ( int processId, string machineName ) : System.Diagnostics.Process
GetProcesses ( ) : System.Diagnostics.Process[]
GetProcesses ( string machineName ) : System.Diagnostics.Process[]
GetProcessesByName ( string processName, string machineName ) : System.Diagnostics.Process[]

Creates an array of Process components that are associated with process resources on a remote computer. These process resources share the specified process name.

GetProcessesByName ( string processName ) : System.Diagnostics.Process[]
GetProcessesByName ( string processName, string machineName ) : System.Diagnostics.Process[]
Kill ( ) : void

Stops the associated process immediately.

LeaveDebugMode ( ) : void

Takes a Process component out of the state that lets it interact with operating system processes that run in a special mode.

Process ( )
Refresh ( ) : void
Start ( System startInfo ) : System.Diagnostics.Process
Start ( string fileName ) : System.Diagnostics.Process
Start ( string fileName, string arguments ) : System.Diagnostics.Process
Start ( ) : bool
ToString ( ) : string
WaitForExit ( int milliseconds ) : bool
WaitForExit ( ) : void
WaitForInputIdle ( ) : bool
WaitForInputIdle ( int milliseconds ) : bool

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void
OnExited ( ) : void

Приватные методы

Метод Описание
BootTimeToDateTime ( System.TimeSpan timespanAfterBoot ) : System.DateTime

Computes a time based on a number of ticks since boot.

BuildCommandLine ( string executableFileName, string arguments ) : StringBuilder
CloseCore ( ) : void

Additional logic invoked when the Process is closed.

CloseMainWindowCore ( ) : bool
ConfigureAfterProcessIdSet ( ) : void

Additional configuration when a process ID is set.

CreateEnvp ( ProcessStartInfo psi ) : string[]

Converts the environment variables information from a ProcessStartInfo into an envp array.

CreatePipe ( SafeFileHandle &parentHandle, SafeFileHandle &childHandle, bool parentInputs ) : void
CreatePipeWithSecurityAttributes ( SafeFileHandle &hReadPipe, SafeFileHandle &hWritePipe, Interop &lpPipeAttributes, int nSize ) : void
EnsureHandleCountPopulated ( ) : void
EnvironmentVariablesToByteArray ( string>.Dictionary sd ) : byte[]
GetCurrentProcessId ( ) : int

Gets the ID of the current process.

GetCurrentProcessRUsage ( ) : Interop.libproc.rusage_info_v3
GetEncoding ( int codePage ) : Encoding
GetExePath ( ) : string

Gets the path to the current executable, or null if it could not be retrieved.

GetMainWindowTitle ( ) : string
GetProcessHandle ( ) : SafeProcessHandle

Gets a short-term handle to the process, with the given access. If a handle exists, then it is reused. If the process has exited, it throws an exception.

GetProcessHandle ( int access ) : SafeProcessHandle
GetProcessHandle ( int access, bool throwIfExited ) : SafeProcessHandle
GetProcessTimes ( ) : System.Diagnostics.ProcessThreadTimes

Gets timing information for the current process.

GetStat ( ) : Interop.procfs.ParsedStat

Reads the stats information for this process from the procfs file system.

GetWaitState ( ) : System.Diagnostics.ProcessWaitState

Gets the wait state for this Process object.

GetWorkingSetLimits ( IntPtr &minWorkingSet, IntPtr &maxWorkingSet ) : void

Get the minimum and maximum working set limits.

IsRespondingCore ( ) : bool
OpenStream ( int fd, FileAccess access ) : FileStream

Opens a stream around the specified file descriptor and with the specified access.

ParseArgumentsIntoList ( string arguments, List results ) : void

Parses a command-line argument string into a list of arguments.

This follows the rules outlined in "Parsing C++ Command-Line Arguments" at https://msdn.microsoft.com/en-us/library/17w5ykft.aspx.

ParseArgv ( ProcessStartInfo psi ) : string[]

Converts the filename and arguments information from a ProcessStartInfo into an argv array.

RefreshCore ( ) : void

Discards any information about the associated process.

ResolvePath ( string filename ) : string

Resolves a path to the filename passed to ProcessStartInfo.

SetPrivilege ( string privilegeName, int attrib ) : void
SetWorkingSetLimitsCore ( IntPtr newMin, IntPtr newMax, IntPtr &resultingMin, IntPtr &resultingMax ) : void

Sets one or both of the minimum and maximum working set limits.

Start ( string fileName, string userName, SecureString password, string domain ) : Process
Start ( string fileName, string arguments, string userName, SecureString password, string domain ) : Process
Start ( string fileName, string userName, System password, string domain ) : System.Diagnostics.Process
Start ( string fileName, string arguments, string userName, System password, string domain ) : System.Diagnostics.Process
StartCore ( ProcessStartInfo startInfo ) : bool

Starts the process using the supplied start info.

TicksToTimeSpan ( double ticks ) : System.TimeSpan

Convert a number of "jiffies", or ticks, to a TimeSpan.

UpdateHasExited ( ) : void

Checks whether the process has exited and updates state accordingly.

WaitForExitCore ( int milliseconds ) : bool

Instructs the Process component to wait the specified number of milliseconds for the associated process to exit.

WaitForInputIdleCore ( int milliseconds ) : bool

Описание методов

BeginErrorReadLine() публичный Метод

public BeginErrorReadLine ( ) : void
Результат void

BeginOutputReadLine() публичный Метод

public BeginOutputReadLine ( ) : void
Результат void

CancelErrorRead() публичный Метод

public CancelErrorRead ( ) : void
Результат void

CancelOutputRead() публичный Метод

public CancelOutputRead ( ) : void
Результат void

Close() публичный Метод

public Close ( ) : void
Результат void

CloseMainWindow() публичный Метод

public CloseMainWindow ( ) : bool
Результат bool

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

EnterDebugMode() публичный статический Метод

Puts a Process component in state to interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread.
public static EnterDebugMode ( ) : void
Результат void

GetCurrentProcess() публичный статический Метод

public static GetCurrentProcess ( ) : System.Diagnostics.Process
Результат System.Diagnostics.Process

GetProcessById() публичный статический Метод

public static GetProcessById ( int processId ) : System.Diagnostics.Process
processId int
Результат System.Diagnostics.Process

GetProcessById() публичный статический Метод

public static GetProcessById ( int processId, string machineName ) : System.Diagnostics.Process
processId int
machineName string
Результат System.Diagnostics.Process

GetProcesses() публичный статический Метод

public static GetProcesses ( ) : System.Diagnostics.Process[]
Результат System.Diagnostics.Process[]

GetProcesses() публичный статический Метод

public static GetProcesses ( string machineName ) : System.Diagnostics.Process[]
machineName string
Результат System.Diagnostics.Process[]

GetProcessesByName() публичный статический Метод

Creates an array of Process components that are associated with process resources on a remote computer. These process resources share the specified process name.
public static GetProcessesByName ( string processName, string machineName ) : System.Diagnostics.Process[]
processName string
machineName string
Результат System.Diagnostics.Process[]

GetProcessesByName() публичный статический Метод

public static GetProcessesByName ( string processName ) : System.Diagnostics.Process[]
processName string
Результат System.Diagnostics.Process[]

GetProcessesByName() публичный статический Метод

public static GetProcessesByName ( string processName, string machineName ) : System.Diagnostics.Process[]
processName string
machineName string
Результат System.Diagnostics.Process[]

Kill() публичный Метод

Stops the associated process immediately.
public Kill ( ) : void
Результат void

LeaveDebugMode() публичный статический Метод

Takes a Process component out of the state that lets it interact with operating system processes that run in a special mode.
public static LeaveDebugMode ( ) : void
Результат void

OnExited() защищенный Метод

protected OnExited ( ) : void
Результат void

Process() публичный Метод

public Process ( )

Refresh() публичный Метод

public Refresh ( ) : void
Результат void

Start() публичный статический Метод

public static Start ( System startInfo ) : System.Diagnostics.Process
startInfo System
Результат System.Diagnostics.Process

Start() публичный статический Метод

public static Start ( string fileName ) : System.Diagnostics.Process
fileName string
Результат System.Diagnostics.Process

Start() публичный статический Метод

public static Start ( string fileName, string arguments ) : System.Diagnostics.Process
fileName string
arguments string
Результат System.Diagnostics.Process

Start() публичный Метод

public Start ( ) : bool
Результат bool

ToString() публичный Метод

public ToString ( ) : string
Результат string

WaitForExit() публичный Метод

public WaitForExit ( int milliseconds ) : bool
milliseconds int
Результат bool

WaitForExit() публичный Метод

public WaitForExit ( ) : void
Результат void

WaitForInputIdle() публичный Метод

public WaitForInputIdle ( ) : bool
Результат bool

WaitForInputIdle() публичный Метод

public WaitForInputIdle ( int milliseconds ) : bool
milliseconds int
Результат bool