Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
1- What is the need of environment variables?
2- How to use/get it in visual studio 2005 solution?
Thanks...
Posted

1 solution

Some environment variables are just system-wide string variables which can modify the behavior of OS (and mostly per the OS user), but most of them can be used by applications in arbitrary manner, to set up some system-wide strings (very typically, path strings) and using them across different application procedure. Such uses are majorly obsolete and indicates poor programming style, which was, however, widely used by some software vendors in near past. If you don't know the use of them right now, I would not advise to worry about them; you may only need to use them to control some legacy application and their installation options, and limited number of modern applications; it's the best to avoid it. For further detail, please see:
http://en.wikipedia.org/wiki/Environment_variable[^].

If you still feel you need to access the environment variable, you can do it via the methods of the class System.Environment, please see:
http://msdn.microsoft.com/en-us/library/system.environment.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900