读取*.properties文件的方法


public class SysUtils{

Properties property = new Properties();
InputStream is = null;
try{
is = SysUtils.class.getClassLoader().getResourceAsStream("system.properties");
property.load(is);
String s = property.getProperty("CMS_URL");
}catch(Excption e){
System.out.println("hi"):
}


}

你可能感兴趣的:(读取*.properties文件的方法)