Environment.ExitCode Property

Gets or sets the exit code of the process.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static int ExitCode { get; set; }

Property Value

Type: System.Int32
A 32-bit signed integer containing the exit code. The default value is zero.

If the Main method returns void, you can use this property to set the exit code that will be returned to the calling environment. If Main does not return void, this property is ignored. The initial value of this property is zero.

You can use this property to return a success code from an application. For example, you can use it control the execution of a set of applications invoked by a script.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: