Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Environment Methods

The Environment type exposes the following members.

  NameDescription
Public method Static member Exit Terminates this process and gives the underlying operating system the specified exit code.
Public method Static member ExpandEnvironmentVariables Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.
Public method Static member FailFast(String) Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message in error reporting to Microsoft.
Public method Static member FailFast(String, Exception) Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and exception information in error reporting to Microsoft.
Public method Static member GetCommandLineArgs Returns a string array containing the command-line arguments for the current process.
Public method Static member GetEnvironmentVariable(String) Retrieves the value of an environment variable from the current process.
Public method Static member GetEnvironmentVariable(String, EnvironmentVariableTarget) Retrieves the value of an environment variable from the current process or from the Windows operating system registry key for the current user or local machine.
Public method Static member GetEnvironmentVariables() Retrieves all environment variable names and their values from the current process.
Public method Static member GetEnvironmentVariables(EnvironmentVariableTarget) Retrieves all environment variable names and their values from the current process, or from the Windows operating system registry key for the current user or local machine.
Public method Static member GetFolderPath(Environment.SpecialFolder) Gets the path to the system special folder that is identified by the specified enumeration.
Public method Static member GetFolderPath(Environment.SpecialFolder, Environment.SpecialFolderOption) Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders.
Public method Static member GetLogicalDrives Returns an array of string containing the names of the logical drives on the current computer.
Public method Static member SetEnvironmentVariable(String, String) Creates, modifies, or deletes an environment variable stored in the current process.
Public method Static member SetEnvironmentVariable(String, String, EnvironmentVariableTarget) Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current user or local machine.
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.