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

读取src上properties配置

2012-08-31 
读取src下properties配置try {String path getClass().getResource(/).getPath()in new BufferedIn

读取src下properties配置

try {String path = getClass().getResource("/").getPath();in = new BufferedInputStream(new FileInputStream(path+PROPERTIES));Properties p = new Properties();p.load(in);String url = p.getProperty("uws.connectUrl");System.out.println(url+"----------------------------url");} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}

?

热点排行