下载地址1:https://securityswitch.googlecode.com/files/SecuritySwitch%20v4.2.0.0%20-%20Binary.zip
1.将下载的"SecuritySwitch.dll"文件放在bin文件夹中,然后添加"SecuritySwitch"引用
2.打开web.config文件为您的web应用程序,或网站,添加如下的配置(注意···线条所包含的地方就是配置)
<configuration> <configSections> ...... <!--配置securitySwitch--> <section name="securitySwitch" type="SecuritySwitch.Configuration.Settings, SecuritySwitch"/> </configSections> ...... <!--配置securitySwitch--> <securitySwitch mode="RemoteOnly" baseInsecureUri="http://www.juqiandai.com" baseSecureUri="https://www.juqiandai.com" bypassSecurityWarning="true" ignoreAjaxRequests="false"> <paths> <add path="~/secure/"/> <add path="~/reg/Logins.aspx" /> <add path="~/Inc/CheckCode.aspx" /> </paths> </securitySwitch> <system.web> <httpModules> ...... <!--配置securitySwitch,for IIS <= 6.x, IIS 7.x + 经典模式, and Web Development Server (Cassini) --> <add name="SecuritySwitch" type="SecuritySwitch.SecuritySwitchModule, SecuritySwitch" /> </httpModules> </system.web> <system.webServer> ...... <!--配置securitySwitch--> <validation validateIntegratedModeConfiguration="false" /> <modules> ...... <!--配置securitySwitch,如果是 IIS 7.x + 集成模式 --> <add name="SecuritySwitch" type="SecuritySwitch.SecuritySwitchModule, SecuritySwitch" /> </modules> </system.webServer> </configuration>
3.将需要加密的页面或者路径添加到<paths></paths>中即可
版权声明:本文为博主原创文章,未经博主允许不得转载。