Static class: System.Environment
Description: The Environment class provides information about the current environment and platform and how to manipulate them. This class cannot be inherited. Use the Environment class to retrieve information, such as command-line arguments, exit codes, environment variable settings, the contents of the call stack, the time since the last system was started, and the version of the common language runtime.
Properties:
Summary: Gets the command line for the process.
public static string CommandLine {get;} Summary: Gets and sets the fully qualified path of the current directory (that is, the directory from which the process starts).
public static string CurrentDirectory {get; set;} Summary: Gets or sets the exit code for the process.
public static int ExitCode {get; set;} Summary: Gets a value indicating whether the common language runtime is shutting down or that the current application domain is unloading.
public static bool hasshutdownstarted {get;} Summary: Gets the NetBIOS name of this local computer. public static string MachineName {get;} summary: Gets the newline string defined for this environment.
"\ r \ n" is used on non-UNIX platforms or "\ n" for UNIX platforms.
public static string newline {get;} Summary: Gets the System.operatingsystem object that contains the current platform identifier and version number.
public static operatingsystem osversion {get;} Summary: Gets the number of processors on the current computer.
public static int ProcessorCount {get;} Summary: Gets the current stack trace information.
public static string StackTrace {get;} Summary: Gets the fully qualified path to the system directory.
public static string Systemdirectory {get;} Summary: Gets the number of milliseconds that elapsed since the system started.
public static int TickCount {get;} Summary: Gets the network domain name associated with the current user.
public static string UserDomainName {get;} Summary: Gets a value indicating whether the current process is running in user interaction mode.
public static bool Userinteractive {get;} Summary: Gets the user name of the person who started the current thread. public static string UserName {get;} summary: Gets a System.version object,This object describes the major, minor, build, and revision numbers of the common language runtime.
public static version version {get;} Summary: Gets the amount of physical memory mapped to the process context. public static long WorkingSet {get;}
method:
Summary: Terminates this process and provides the specified exit code for the underlying operating system.
public static void Exit (int exitcode);
Summary: Replaces each environment variable name embedded in the specified string with the equivalent string of the value of the variable, and then returns the result string.
public static string Expandenvironmentvariables (string name);
Summary: Terminates a process without executing any active try-finally blocks or finalizers.
public static void FailFast (String message);
Summary: Returns an array of strings containing command-line arguments for the current process.
public static string[] GetCommandLineArgs ();
Summary: Retrieves the value of an environment variable from the current process.
public static string GetEnvironmentVariable (string variable);
Summary: 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 computer.
public static string GetEnvironmentVariable (string variable, environmentvariabletarget target);
Summary: Retrieves all environment variable names and their values from the current process.
public static IDictionary getenvironmentvariables ();
Summary: 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 computer.
public static IDictionary Getenvironmentvariables (EnvironmentVariableTarget target);
Summary: Gets the path to the system special folder that is identified by the specified enumeration.
public static string GetFolderPath (Environment.SpecialFolder folder);
Summary: Returns an array of strings containing the names of logical drives in the current computer.
public static string[] GetLogicalDrives ();
Summary: Creates, modifies, or deletes an environment variable stored in the current process. public static void Setenvironmentvariable (String variable, string value);
Summary: Creates, modifies, or deletes an environment variable stored in the current process or in a Windows operating system registry key reserved for the current user or the local computer.
public static void Setenvironmentvariable (string variable, string value, EnvironmentVariableTarget target);