Skip to Main Content
C# in a Nutshell, Second Edition
book

C# in a Nutshell, Second Edition

by Peter Drayton, Ben Albahari, Ted Neward
August 2003
Intermediate to advanced content levelIntermediate to advanced
928 pages
32h 1m
English
O'Reilly Media, Inc.
Content preview from C# in a Nutshell, Second Edition

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 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# in a Nutshell

C# in a Nutshell

Ben Albahari, Ted Neward, Peter Drayton
C# 7.0 in a Nutshell

C# 7.0 in a Nutshell

Joseph Albahari, Ben Albahari
C# Cookbook, 2nd Edition

C# Cookbook, 2nd Edition

Jay Hilyard, Stephen Teilhet
C# Cookbook

C# Cookbook

Joe Mayo

Publisher Resources

ISBN: 0596005261Catalog PageErrata