properties读取
2018-07-20 来源:open-open
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class readproperties {
public static void main(String[] args) {
//配置文件放在src下
InputStream inStream= (InputStream) readproperties.class.getClassLoader().
getResourceAsStream("ApplicationResources.properties");//.ApplicationResources.properties
Properties properties=new Properties();
try {
properties.load(inStream);
} catch (IOException e) {
e.printStackTrace();
}
String value=properties.getProperty("key");
System.out.println("getProperty...................."+value);
}
}
标签: ssl
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
下一篇:从数据库中随机的取出n条数据
最新资讯
热门推荐