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

读取Properties资料

2012-09-24 
读取Properties文件利用Properties文件配置信息,读取properties文件InputStream isThread.CurrentThread(

读取Properties文件
利用Properties文件配置信息,读取properties文件

InputStream is=Thread.CurrentThread().getContextClassLoad().getResourceAsStream("properties.properties");Properties props=new Properties();props.load(is);//可读取properties中的键值对形式props.getProperty("driver")     //driver是properties文件中的键,读取以后获取它对应的值

热点排行