System.Environment - Execution Environment Class
This section describes the execution environment class, System.Environment, which allows you to retrieve information about and manipulate the current environment and platform.
.NET Framework supports a special class called, System.Environment,
that allows you to retrieve information about and manipulate
the current environment and platform.
System.Environment has some interesting properties and methods:
- CurrentDirectory - Property to get or set the fully qualified path of the current working directory.
- ExitCode - Property to get or set the exit code of the process.
- OSVersion - Property to get the version information of the operating system.
- ProcessorCount - Property to get the number of processors.
- UserName - Property to get the current logged in user name.
- Version - Property to get the version information of the common language runtime.
- WorkingSet - Property to get the amount of physical memory mapped to this process.
- Exit(int) - Method to terminates this process with the specified exit code.
- GetCommandLineArgs() - Method to return the command line arguments as an array.
- GetEnvironmentVariables() - Method to return all environment variables as an array.
- GetEnvironmentVariable(String) - Method to return the value of an environment variable.
- SetEnvironmentVariable(String, String) - Method to set a new value to an environment variable.
Last update: 2010.
Table of Contents
About This Book
Introduction of C# (C Sharp)
Data Type and Variables
Logical Expressions and Conditional Statements
Arrays and Loop Statements
Data Type Features
Floating-Point Data Types
Passing Parameters to Methods
►Execution Environment Class
►System.Environment - Execution Environment Class
Getting Operating System Information
Getting CLR (Common Language Runtime) Information
Visual C# 2010 Express Edition
C# Compiler and Intermediate Language
Compiling C# Source Code Files
MSBuild - Microsoft Build Engine
Memory Usages of Processes
Multithreading in C#
Async Feature from C# 5
WPF - Windows Presentation Foundation
Partial Classes and Partial Methods
PDF Printing Version