什么是环境变量的需要以及如何在Visual Studio 2005解决方案中使用/获取它 [英] What is the need of Environment variables and how to use/get it in visual studio 2005 solution

查看:62
本文介绍了什么是环境变量的需要以及如何在Visual Studio 2005解决方案中使用/获取它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
1-需要什么环境变量?
2-如何在Visual Studio 2005解决方案中使用/获取它?
谢谢...

Hi all,
1- What is the need of environment variables?
2- How to use/get it in visual studio 2005 solution?
Thanks...

推荐答案

某些环境变量只是系统范围内的字符串变量,可以修改OS的行为(大多数情况下针对OS用户),但是大多数应用程序可以通过任意方式使用它们,以设置一些系统范围的字符串(通常是路径字符串),并在不同的应用程序过程中使用它们.这种用法主要是过时的,表明编程风格较差,但是,在不久的将来,这种用法已被某些软件供应商广泛使用.如果您现在不知道它们的用途,我不建议您担心它们.您可能只需要使用它们来控制某些旧版应用程序及其安装选项,以及数量有限的现代应用程序;最好避免这种情况.有关更多详细信息,请参见:
http://en.wikipedia.org/wiki/Environment_variable [ http://msdn.microsoft.com/en-us/library/system.environment.aspx [ ^ ].

—SA
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


这篇关于什么是环境变量的需要以及如何在Visual Studio 2005解决方案中使用/获取它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆