java 读取配置文件,
分享于 点击 23417 次 点评:112
java 读取配置文件,
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();
}
相关文章
- 暂无相关文章
用户点评