Mono Class Library: System.Environment Overview | Members

System.Environment.Exit Method

Terminates the current process and sets the process exit code to the specified value.

public static void Exit (int exitCode)

Parameters

exitCode
A int value that is provided to the operating system.

Permissions

TypeReason
System.Security.Permissions.EnvironmentPermissionRequires permission to read environment variables. See System.Security.Permissions.EnvironmentPermissionAccess.Read.
System.Security.Permissions.SecurityPermissionRequires unmanaged code permission. See System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode.

Exceptions

TypeReason
System.Security.SecurityExceptionThe immediate caller does not have the required permission.

Remarks

This method causes an executing program to halt.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0