1 out of 2 rated this helpful - Rate this topic

Environment Members

Provides information about, and means to manipulate, the current environment and platform. This class cannot be inherited.

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 Terminates a process but does not execute any active try-finally blocks or finalizers.
Public method Static member GetCommandLineArgs Returns a string array containing the command-line arguments for the current process.
Public method Static member GetEnvironmentVariable Overloaded. Retrieves the value of an environment variable.
Public method Static member GetEnvironmentVariables Overloaded. Retrieves all environment variable names and their values.
Public method Static member Supported by the .NET Compact Framework Supported by the XNA Framework GetFolderPath Gets the path to the system special folder identified by the specified enumeration.
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 Overloaded. Creates, modifies, or deletes an environment variable.
Top
  NameDescription
Public property Static member CommandLine Gets the command line for this process.
Public property Static member CurrentDirectory Gets or sets the fully qualified path of the current working directory.
Public property Static member ExitCode Gets or sets the exit code of the process.
Public property Static member HasShutdownStarted Gets a value indicating whether the common language runtime is shutting down or the current application domain is unloading.
Public property Static member MachineName Gets the NetBIOS name of this local computer.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework NewLine Gets the newline string defined for this environment.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework OSVersion Gets an OperatingSystem object that contains the current platform identifier and version number.
Public property Static member Supported by the XNA Framework ProcessorCount Gets the number of processors on the current machine.
Public property Static member StackTrace Gets current stack trace information.
Public property Static member SystemDirectory Gets the fully qualified path of the system directory.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework TickCount Gets the number of milliseconds elapsed since the system started.
Public property Static member UserDomainName Gets the network domain name associated with the current user.
Public property Static member UserInteractive Gets a value indicating whether the current process is running in user interactive mode.
Public property Static member UserName Gets the user name of the person who is currently logged on to the Windows operating system.
Public property Static member Supported by the .NET Compact Framework Supported by the XNA Framework Version Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.
Public property Static member WorkingSet Gets the amount of physical memory mapped to the process context.
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.