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

Properties资料放在哪儿

2012-12-25 
Properties文件放在哪儿?Properties p new Properties() InputStream in 当前类.class.getResourceAs

Properties文件放在哪儿?

Properties p = new Properties(); InputStream in = 当前类.class.getResourceAsStream("Properties文件名");p.load(in);


这种情况下Properties文件放在和‘当前类’同一目录下


Properties p = new Properties(); InputStream in = 当前类.class.getClassLoader().getResourceAsStream("Properties文件名");p.load(in);


这种情况下Properties文件放在src根目录下 1 楼 czkun1986 2011-10-19   正好是想要的东西

热点排行