冬瓜茶饮料

Java 读取Properties配置文件

1、img_url.properties

imgurl=http://10.1.19.65:8090

  

2、Test.java

InputStream inputStream = this.getClass().getResourceAsStream("/img_url.properties");
            Properties p = new Properties();
            try {
                p.load(inputStream);
            } catch (IOException e1) {
                e1.printStackTrace();
            }
System.out.println("imgurl="+p.getProperty("imgurl"));

 

posted on 2016-04-29 11:13  冬瓜茶饮料  阅读(365)  评论(0编辑  收藏  举报

导航