首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

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

2012-12-27 
java 读取配置.properties文件类型的值1.functionConfig.propertiesprivate static BundleConfig con nu

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();}}


热点排行