| 发表于:2007-01-23 10:06:086楼 得分:0 |
using system; using system.collections.generic; using system.text; using system.collections; namespace test2 { class program { static void main(string[] args) { // 把环境变量中所有的值取出来,放到变量environment中 idictionary environment = environment.getenvironmentvariables(); // 打印表头 console.writeline( "环境变量名\t=\t环境变量值 "); // 遍历environment中所有键值 foreach (string environmentkey in environment.keys) { // 打印出所有环境变量的名称和值 console.writeline( "{0}\t=\t{1} ", environmentkey, environment[environmentkey].tostring()); } console.read(); } } } ***************************************************************************** 欢迎使用csdn论坛阅读器 : csdn reader(附全部源代码) http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html | | |
|