AJPFX关于读取properties 配置文件 返回属性值

时间:2023-03-09 05:14:59
AJPFX关于读取properties 配置文件 返回属性值

:Properties的概述
        * Properties 类表示了一个持久的属性集。
        * Properties 可保存在流中或从流中加载。
        * 属性列表中每个键及其对应值都是一个字符串。
            Properties props = new Properties();   
    
           InputStream in = new BufferedInputStream(new FileInputStream(   
                   filePath));   //filePath 为配置文件的地址  
           props.load(in);   
           String value = props.getProperty(key);   
         System.out.println(key +"键的值是:"+ value);   
          return value;