zoukankan      html  css  js  c++  java
  • 配置文件读取名值对

        Properties props = test.readProperties(filepath);//此对象方法返回加载好的Properties

        
        Enumeration enA = props.propertyNames();
        while (enA.hasMoreElements()) {
         String Akey = (String) enA.nextElement();
         String Property = props.getProperty(Akey);
         System.out.println(Akey+" ---- " + Property);
        }

        Enumeration en = props.elements();//这个方法取到的是值,没有名
        while (en.hasMoreElements()) {
         String tmpKey = (String) en.nextElement();

         String tmpvalue = (String) props.getProperty(tmpKey);//以值为名,取值,若不存在这个值的名,取出来肯定是null
       %>
       key : <%=tmpKey%>
       value: <%=tmpvalue%><br>
       <%
        }

  • 相关阅读:
    @bzoj
    @hdu
    @noi.ac
    @noi.ac
    @noi.ac
    jsp include page指令标记
    javascript 对象(DOM)document window history
    HTML 标准属性 和 事件属性
    html 特殊字符 fmt table A
    mysql 启动 导入sql文件
  • 原文地址:https://www.cnblogs.com/shsgl/p/3919060.html
Copyright © 2011-2022 走看看