Use of System.Environment Class
The System.Environment Class provides information about the current environment and platform. The System.Environment Class uses to retrieve Environment variable settings, Version of the common language runtime, contents of the call stack etc. This class cannot be inherited.
How to get Current working directory ?
System.Environment.CurrentDirectory - will return your current working directory
How to get Machine Name ?
System.Environment.MachineName - will return your current machine name.
How to get current Operating System Version ?
System.Environment.OSVersion.ToString () - will return your current operating system version
How to get the current user name of the system ?
System.Environment.UserName - will return your current user name
How to add a New line in a text file ?
C# Source Code
How to add a blank line in a text file ?
VB.Net Source Code
- C# Interview Questions (part-1)
- C# Interview Questions (part-2)
- C# Interview Questions (part-3)
- Difference between a Debug and Release build
- Difference between normal DLL and .Net DLL
- What is an Interface in C#
- Difference between Abstract Class and Interface
- Difference between a thread and a process
- Delegates in C# with Examples
- Differences between a control and a component
- Differences between Stack and Heap
- What is .Net Reflection
- Globalization and Localization
- What is .Net serialization
- Difference between web service and .net remoting
- Difference between managed and unmanaged code
- Difference between Shallow copy and Deep copy
- What is the difference between private and shared assembly?
- Does the .NET have in-built support for serialization?
- How to properly stop the Thread in C#?
- Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
- Why is XmlSerializer so slow?
- How many types of Jit Compilers?