ProcessStartInfo Constructors

Definition

Initializes a new instance of the ProcessStartInfo class.

Overloads

ProcessStartInfo()

Initializes a new instance of the ProcessStartInfo class without specifying a file name with which to start the process.

ProcessStartInfo(String)

Initializes a new instance of the ProcessStartInfo class and specifies a file name such as an application or document with which to start the process.

ProcessStartInfo(String, String)

Initializes a new instance of the ProcessStartInfo class, specifies an application file name with which to start the process, and specifies a set of command-line arguments to pass to the application.

ProcessStartInfo()

Initializes a new instance of the ProcessStartInfo class without specifying a file name with which to start the process.

public:
 ProcessStartInfo();
public ProcessStartInfo ();
Public Sub New ()

Remarks

You must set at least the FileName property before you start the process. The file name is any application or document. In this case, a document is defined to be any file type that has an open or default action associated with it. You can view registered file types and their associated applications for your computer by using the Folder Options dialog box, which is available through the operating system. The Advanced button leads to a dialog box that shows whether there is an open action associated with a specific registered file type.

Optionally, you can also set other properties before you start the process. The Verb property supplies actions to take, such as "print", with the file indicated in the FileName property. The Arguments property supplies a way to pass command-line arguments to the file when the system opens it.

Security

LinkDemand
for full trust for the immediate caller. This member cannot be used by partially trusted code.

ProcessStartInfo(String)

Initializes a new instance of the ProcessStartInfo class and specifies a file name such as an application or document with which to start the process.

public:
 ProcessStartInfo(System::String ^ fileName);
public ProcessStartInfo (string fileName);
new System.Diagnostics.ProcessStartInfo : string -> System.Diagnostics.ProcessStartInfo
Public Sub New (fileName As String)

Parameters

fileName
String

An application or document with which to start a process.

Remarks

The file name is any application or document. In this case, a document is defined to be any file type that has an open or default action associated with it. You can view registered file types and their associated applications for your computer by using the Folder Options dialog box, which is available through the operating system. The Advanced button leads to a dialog box that shows whether there is an open action associated with a specific registered file type.

You can change the FileName property after you call this constructor, up to the time that the process starts. After you start the process, changing these values has no effect.

Security

LinkDemand
for full trust for the immediate caller. This member cannot be used by partially trusted code.

ProcessStartInfo(String, String)

Initializes a new instance of the ProcessStartInfo class, specifies an application file name with which to start the process, and specifies a set of command-line arguments to pass to the application.

public:
 ProcessStartInfo(System::String ^ fileName, System::String ^ arguments);
public ProcessStartInfo (string fileName, string arguments);
new System.Diagnostics.ProcessStartInfo : string * string -> System.Diagnostics.ProcessStartInfo
Public Sub New (fileName As String, arguments As String)

Parameters

fileName
String

An application with which to start a process.

arguments
String

Command-line arguments to pass to the application when the process starts.

Remarks

The file name is any application or document. In this case, a document is defined to be any file type that has an open or default action associated with it. You can view registered file types and their associated applications for your computer by using the Folder Options dialog box, which is available through the operating system. The Advanced button leads to a dialog box that shows whether there is an open action associated with a specific registered file type.

You can change the FileName or Arguments properties after you call this constructor, up to the time that the process starts. After you start the process, changing these values has no effect.

Security

LinkDemand
for full trust for the immediate caller. This member cannot be used by partially trusted code.

Applies to