这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
faq:license2-description [2018/03/07 02:45] admin 创建 |
faq:license2-description [2018/03/07 03:04] (当前版本) admin [ERP如何从新License中读取到旧的License?] |
||
---|---|---|---|
行 1: | 行 1: | ||
====== License2.xml和License.xml有什么区别? ====== | ====== License2.xml和License.xml有什么区别? ====== | ||
+ | |||
+ | ===== 格式变化 ===== | ||
+ | |||
+ | 新License结构: | ||
+ | |||
+ | {{:faq:pasted:20180307-024800.png}} | ||
+ | |||
+ | ===== 对比旧License,有哪些变化 ===== | ||
+ | |||
+ | - 一个客户购买多套版本产品只有一个license文件 | ||
+ | - 新license文件合并多套版本的旧license数据 | ||
+ | - license节点上增加了version属性区别版本,增加了productVersion属性,配合Web.config配置ERP-License-ProductVersion取数license数据 | ||
+ | - license签名使用私钥签名,私钥以X509证书方式保存。 | ||
+ | - 新license文件编码是utf-8,旧license文件编码是gb2312。 | ||
+ | |||
+ | ===== ERP如何从新License中读取到旧的License? ===== | ||
+ | |||
+ | 1、从WebConfig的AppSettings节点中读取到属性ERP-License-ProductVersion的值。 | ||
+ | | ||
+ | <code> | ||
+ | System.Configuration.ConfigurationManager.AppSettings["ERP-License-ProductVersion"] | ||
+ | </code> | ||
+ | | ||
+ | 2、在XML中使用XPath检索 | ||
+ | | ||
+ | <code> | ||
+ | xmlDocument.SelectSingleNode("/licenseArray/licenses/license[@productVersion=\"" + ProductVersion + "\"]") | ||
+ | </code> | ||
+ | | ||
+ | 3、上述节点的查询结果的OuterXml就是旧License的内容. | ||
+ | |||
+ | ===== 核心ERP的调整 ===== | ||
+ | |||
+ | 影子License其实就是旧版本license.xml文件,时随着新license2.xml自动生成。 | ||
+ | 这样核心ERP读取license信息的代码不用调整,依旧按照原来的方式读取license.xml文件,最大限制减小对核心ERP的影响。 | ||
+ | |||
+ | - 影子License会随License2.xml自动刷新 | ||
+ | - 读取License信息,可以直接读取旧License文件, | ||
+ | - Web.config没有配置ERP-License-ProductVersion,则使用License.xml | ||
+ | - Web.config配置ERP-License-ProductVersion,则使用License2.xml | ||
+ | 此时ERP-License-ProductVersion版本号必须有一个对应License2.xml中license节点属性productVersion值 | ||
+ | |||
+ | ===== 重构ERP的调整 ===== | ||
+ | |||
+ | - bin下没有旧License文件 | ||
+ | - 只能读取License2.xml文件 | ||
+ | 重构ERP只存在一个license文件,且必须是License2.xml文件,存放在bin目录中。 | ||
+ | web.config必须配置ERP-License-ProductVersion,且必须有一个对应License2.xml中license节点属性productVersion值 | ||
+ | |||