A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/dotnet/api/system.environment.exit below:

Environment.Exit(Int32) Method (System) | Microsoft Learn

Environment.Exit(Int32) Method Definition

Terminates this process and returns an exit code to the operating system.

public:
 static void Exit(int exitCode);
public static void Exit(int exitCode);
static member Exit : int -> unit
Public Shared Sub Exit (exitCode As Integer)
Parameters
exitCode
Int32

The exit code to return to the operating system. Use 0 (zero) to indicate that the process completed successfully.

Exceptions

The caller does not have sufficient security permission to perform this function.

Remarks

For the exitCode parameter, use a non-zero number to indicate an error. In your application, you can define your own error codes in an enumeration, and return the appropriate error code based on the scenario. For example, return a value of 1 to indicate that the required file is not present, and a value of 2 to indicate that the file is in the wrong format. For a list of exit codes used by the Windows operating system, see System Error Codes in the Windows documentation.

Calling the Exit method differs from using your programming language's return statement in the following ways:

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4