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);
}
}
}
Properties读取配置文件
最新推荐文章于 2020-07-03 12:45:39 发布