java 读取配置文件
Properties pps;
Enumeration enum1;
try {
//读取配置文件
pps=new Properties();
pps.load(new FileInputStream("config.ini"));
enum1 = pps.propertyNames();
while (enum1.hasMoreElements()) {
String strKey = (String) enum1.nextElement();String strValue = pps.getProperty(strKey);
System.out.println(strKey + "=" + strValue);
}
} catch (Exception e) {
e.printStackTrace();
}