Wednesday, June 24, 2009

How to List All System Properties


// Get all system properties
Properties props = System.getProperties();

// Enumerate all system properties
Enumeration enum = props.propertyNames();
for (; enum.hasMoreElements(); ) {
// Get property name
String propName = (String)enum.nextElement();

// Get property value
String propValue = (String)props.get(propName);
}

0 comments:

 

Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez