欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

java 读取配置文件,

来源: javaer 分享于  点击 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();  

相关文章

    暂无相关文章
相关栏目:

用户点评