Skip to Main Content
C# in a Nutshell
book

C# in a Nutshell

by Ben Albahari, Ted Neward, Peter Drayton
March 2002
Intermediate to advanced content levelIntermediate to advanced
864 pages
31h 8m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell

Name

ProcessStartInfo

Synopsis

This class is used to configure how a process is started or to view the settings a process was started with. To start a process, set FileName to the full path of the application or file, then pass the ProcessStartInfo instance to Process.Start(). FileName is the only property you must set. Use the other properties for more control. (Use Arguments to specify the command-line arguments.)

In Windows, each document type has a verb that you can use to do different things with. (for example, a Microsoft Word document has an open and a print verb). To consult the possible verbs for a specific file, enumerate the Verbs property after you have set FileName. To start a process with a specific verb, set Verb.

To change the standard error, input, or output source or targets (usually the system console) set one or more of RedirectStandardError, RedirectStandardInput or RedirectStandardOutput to true. This enables the Process.StandardError, Process.StandardInput, and Process.StandardOutput properties, which you can then set as needed. Set the EnvironmentVariables and WorkingDirectory to change the default process start behavior. If the process cannot be started, you can display an error dialog window by setting ErrorDialog (set the handle of the dialog’s parent window with ErrorDialogParentHandle). If you set CreateNoWindow, a new window is not created to start the new process. However, if you want a window, set its style by setting WindowStyle. You can also specify ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# 8.0 in a Nutshell

C# 8.0 in a Nutshell

Joseph Albahari, Eric Johannsen
C# 10 in a Nutshell

C# 10 in a Nutshell

Joseph Albahari
C# in a Nutshell, Second Edition

C# in a Nutshell, Second Edition

Peter Drayton, Ben Albahari, Ted Neward
Code like a Pro in C#

Code like a Pro in C#

Jort Rodenburg

Publisher Resources

ISBN: 0596001819Catalog PageErrata