首页 > 其他 > 详细

静态读配置文件

时间:2015-02-11 12:16:57      阅读:239      评论:0      收藏:0      [点我收藏+]
/**
* 读配置文件
* @param configPath 配置文件路径
* @param key
* @return
*/
public static String getPropertyFromConfigByKey(String configPath, String key){
Properties pros=new Properties();
InputStream is=Utils.class.getResourceAsStream(configPath);
try {
pros.load(is);
} catch (IOException e) {
e.printStackTrace();
}
String iispath=pros.getProperty(key);
return iispath;
}

 

静态读配置文件

原文:http://www.cnblogs.com/xuhj/p/4285539.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!