【Java】get SystemProperties

xiangjinling發表於2010-09-21
get SystemProperties[@more@]

Properties pros=System.getProperties();
Enumeration enumer=pros.propertyNames();

int i=1;
while(enumer.hasMoreElements())
{
String ddle=(String) enumer.nextElement();
System.out.print(i+":"+ddle+"___");
System.out.println(System.getProperty(ddle));
i++;
}

----------------------------------------------

1:java.runtime.name___Java(TM) 2 Runtime Environment, Standard Edition
2:sun.boot.library.path___C:Program FilesJavajre1.5.0_15bin
3:java.vm.version___1.5.0_15-b04
4:java.vm.vendor___Sun Microsystems Inc.
.

.

47:file.separator___
48:java.vendor.url.bug___
49:sun.cpu.endian___little
50:sun.io.unicode.encoding___UnicodeLittle
51:sun.desktop___windows
52:sun.cpu.isalist___pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24167472/viewspace-1038727/,如需轉載,請註明出處,否則將追究法律責任。

相關文章