package com.wanda.crs.utils;

import java.io.IOException;
import java.util.Properties;

public class PropertyUtil {
    public String getProperty(String fileName,String key){
        String value = null;
        Properties pro = new Properties();
        try {
            pro.load(getClass().getResourceAsStream(fileName));
            if(pro.containsKey(key))
                value = pro.getProperty(key).trim();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return value;        
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-26
  • 2021-06-23
  • 2021-09-25
  • 2021-12-06
  • 2021-07-29
  • 2022-02-11
  • 2021-09-21
相关资源
相似解决方案