标签:
调用方法:String url = PropertiesUtil.getProperty("url");
public class PropertiesUtil { public static Properties property; static { property = new Properties(); InputStream in = PropertiesUtil.class.getResourceAsStream("/init.properties"); try { property.load(in); } catch (IOException e) { e.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } } public static String getProperty(String key) { return property.getProperty(key); } }
标签:
原文地址:http://www.cnblogs.com/zhaojinhui/p/4993751.html