แก้ไข

แชร์ผ่าน


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, IEnumerable<String>)
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()

Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs

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.

Important

Using an instance of this object with untrusted data is a security risk. Use this object only with trusted data. For more information, see Validate All Inputs.

Applies to

ProcessStartInfo(String)

Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs

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.

Important

Using an instance of this object with untrusted data is a security risk. Use this object only with trusted data. For more information, see Validate All Inputs.

Applies to

ProcessStartInfo(String, IEnumerable<String>)

Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs
public:
 ProcessStartInfo(System::String ^ fileName, System::Collections::Generic::IEnumerable<System::String ^> ^ arguments);
public ProcessStartInfo (string fileName, System.Collections.Generic.IEnumerable<string> arguments);
new System.Diagnostics.ProcessStartInfo : string * seq<string> -> System.Diagnostics.ProcessStartInfo
Public Sub New (fileName As String, arguments As IEnumerable(Of String))

Parameters

fileName
String
arguments
IEnumerable<String>

Applies to

ProcessStartInfo(String, String)

Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs
Source:
ProcessStartInfo.cs

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.

Important

Using an instance of this object with untrusted data is a security risk. Use this object only with trusted data. For more information, see Validate All Inputs.

Applies to