属性文件.properties读取工具PropertyUtil
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; } }
划船不用桨、杨帆不等风、一生全靠浪