您的位置:首页 > 产品设计 > UI/UE

Java获取.properties配置文件某一项value根据key值

2015-09-23 16:06 776 查看
public static String getProperty(String key){
InputStream in = PropertiesUtils.class.getResourceAsStream("/conf.properties");
Properties properties = new Properties();
String value;
try {
properties.load(in);
value = properties.getProperty(key);
in.close();
return value;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: