System.setProperty

2014-11-24 02:57:37 · 作者: · 浏览: 1

Java代码
System.setProperty( "package.access", "-----" );
System.out.println(System.getProperty( "package.access"));


InputStream inputStream = null ;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
inputStream = cl.getResourceAsStream("SreeBundle.properties");
Properties props = new Properties();

try {
props.load(inputStream);
String messageA = props.getProperty("res_report_total_");
System.out.println("---"+messageA);
} catch (IOException e) {
e.printStackTrace();
}

作者“oywl2008”