1
private static Properties properties1= new Properties();
static {
InputStream inputStream = GoodsSpuService.class.getClassLoader().getResourceAsStream(“logistics.properties”);
try {
properties1.load(inputStream);
}catch (Exception e){
e.printStackTrace();
}
}
2
注意properties里面的等号右边不能有符号!!!!!!
//电商ID
logistics.EBusinessID=1444275
//电商加密私钥,快递鸟提供,注意保管,不要泄漏
logistics.AppKey=a70d88f8-41af-4d67-90ea-8e16124a671d
//请求url
logistics.ReqURL=http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx
后面在用properties里面的内容是就(String)properties1.getProperty(properties文件等号左边的内容)
读取properties里面的文件
最新推荐文章于 2023-07-11 10:59:18 发布