码迷,mamicode.com
首页 > 编程语言 > 详细

java读取配置文件中数据

时间:2016-07-05 18:35:43      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

Properties pps=new Properties();
        try {
            pps.load(new FileInputStream("src/email.properties"));
            Enumeration enum1 = pps.propertyNames();
            while (enum1.hasMoreElements()) {
                String strKey = (String) enum1.nextElement();
                   String strValue = pps.getProperty(strKey);
                   System.out.println(strKey + "=" + strValue);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

java读取配置文件中数据

标签:

原文地址:http://www.cnblogs.com/leifei/p/5644545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!