Hi,
What do you do when you need to find the values of various environment variables in the system like USERDOMAIN, PROCESSOR_ARCHITECTURE, COMPUTERNAME, USERNAME, PROCESSOR_IDENTIFIER, etc. well with asp.net this can be a very simple Job. You can get all these value along with a set of other values with the help of
Environment.GetEnvironmentVariables().
The static function returs the IDictionary collection of the Envirement varibales. To view the value you need to know the key for each value. But its not always known to us.
So what you can do is bind the dictionary to a grid view and see all the keys and values avilable.
You will not be able to bind the collection directly to a gridview with AutoGenerateColumns property true (which is the default value). To bind a type IDictionary to a gridview, we need to set the AutoGenerateColumns to false and add 2 bound columns with datafield key and value. This will display the list of all the envirement variables along with their value.
Vikram