diff --git a/WebSiteCode/Cmdjy/Cmdjy/Bll/DesHelper.cs b/WebSiteCode/Cmdjy/Cmdjy/Bll/DesHelper.cs index acfc1b9..9e4d97d 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Bll/DesHelper.cs +++ b/WebSiteCode/Cmdjy/Cmdjy/Bll/DesHelper.cs @@ -76,7 +76,7 @@ namespace Cmdjy.Bll /// public static DesHelper GetHelper() { if(_deshelper == null) { - var key = ""; + var key = WebSettings.DesKey; byte[] IV = { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08 }; _deshelper = GetHelper(PaddingMode.PKCS7,CipherMode.CBC,IV,key); diff --git a/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj b/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj index 05255ad..23e3bda 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj +++ b/WebSiteCode/Cmdjy/Cmdjy/Cmdjy.csproj @@ -165,6 +165,7 @@ Global.asax + HisInterface.asmx Component diff --git a/WebSiteCode/Cmdjy/Cmdjy/Web.config b/WebSiteCode/Cmdjy/Cmdjy/Web.config index 129ea88..a2d1a61 100644 --- a/WebSiteCode/Cmdjy/Cmdjy/Web.config +++ b/WebSiteCode/Cmdjy/Cmdjy/Web.config @@ -13,6 +13,10 @@ + + + + + /// 网站配置 + /// + public static class WebSettings + { + /// + /// 获取配置的值 + /// + /// + /// + public static string GetValue(String key) { + var val = ConfigurationManager.AppSettings[key]; + return val; + } + /// + /// 万仕达加密通信用的的加密key + /// + public static string DesKey { + get => GetValue("DesKey") ?? throw new Exception("必须在web.config文件appSettings节配置DesKey的值"); + } + } +} \ No newline at end of file