Monday, June 05, 2006

Environment Variables

Visual Studio 2003, C#

Recently I need to get user's data location.
I found out that I can get it using Environment.GetEnvironmentVariable("UserProfile").
So I'm curious, what else are in the Environment namespace. A nice article written by Naveen K Kohei can be found here http://www.codeproject.com/dotnet/netdiagnostics4.asp
in addition, I also list all variables on my machine. And here is the result :

Variable Name : SystemDrive
Variable Name : USERPROFILE
Variable Name : MSDevDir
Variable Name : INCLUDE
Variable Name : Path
Variable Name : LOGONSERVER
Variable Name : VS71COMNTOOLS
Variable Name : PROCESSOR_ARCHITECTURE
Variable Name : CVS
Variable Name : ProgramFiles
Variable Name : NUMBER_OF_PROCESSORS
Variable Name : CommonProgramFiles
Variable Name : TMP
Variable Name : APPDATA
Variable Name : ComSpec
Variable Name : FP_NO_HOST_CHECK
Variable Name : HOMEDRIVE
Variable Name : COMPUTERNAME
Variable Name : PROCESSOR_LEVEL
Variable Name : OS
Variable Name : PROCESSOR_IDENTIFIER
Variable Name : USERDNSDOMAIN
Variable Name : windir
Variable Name : USERDOMAIN
Variable Name : ALLUSERSPROFILE
Variable Name : USERNAME
Variable Name : PATHEXT
Variable Name : CLIENTNAME
Variable Name : HOMEPATH
Variable Name : SystemRoot
Variable Name : TEMP
Variable Name : LIB
Variable Name : PROCESSOR_REVISION
Variable Name : SESSIONNAME
Variable Name : Cor_Debugging_Control_424242