您的位置:首页 > 运维架构

Properties读取配置文件

2016-04-25 17:28 477 查看
static Properties	webProper	=	new Properties();
static InputStream	is;
public sendTelMsg(){
//从配置文件中获取默认域名
if (is==null) {
is=sendTelMsg.class.getClass().getResourceAsStream("/配置文件名称.properties");
try {
webProper.load(is);

webProper.getProperty("msgSDUser");
webProper.getProperty("msgSDKey");
webProper.getProperty("DYKey");
webProper.getProperty("DYSecret");
webProper.getProperty("DYSign");
System.err.println("=====This SMS====");
} catch (IOException e) {
System.out.println(e);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: