读书人

java 读取配备.properties文件类型的值

发布时间: 2012-12-27 10:17:10 作者: rapoo

java 读取配置.properties文件类型的值

1.functionConfig.properties


private static BundleConfig con = null;public static void main(String[] args) {try {con=new BundleConfig("functionConfig");//配置文件名字functionConfig.propertiesString str=con.getString("ch_address");//根据文件内名称获取对象的值if(str.length()>1){str= str.substring(0, str.length()-1);}System.out.println(str);} catch (BundleConfigException e) {// TODO Auto-generated catch blocke.printStackTrace();}}


读书人网 >编程

热点推荐