如何使用HTTPS在ASP.Net应用程序 [英] How to use HTTPS in an ASP.Net Application
问题描述
我想用HTTPS在我的ASP.NET Web应用程序,但只适用于为Login.aspx页面。
这怎么可能实现呢?
-
首先获取或创建证书
-
获取从<一的SecureWebPageModule模块href=\"http://www.$c$cproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver\">http://www.$c$cproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver.说明安装程序可以在文章中找到。
-
添加secureWebPages标签的web.config
&LT;结构&gt;
...
&LT; secureWebPages启用=真正的&GT;
...
&LT; / secureWebPages&GT;
...
&LT;&的System.Web GT;
...
&LT; /system.web>
&LT; /结构&gt; -
添加文件和目录是使用了https协议:
&LT;启用=真正的&GT secureWebPages;
&LT;文件路径=的Login.aspx/&GT;
&LT;文件路径=管理/ Calendar.aspx忽略=真/&GT;
&LT;文件路径=会员/ Users.aspx/&GT;
&LT;目录路径=管理/&GT;
&LT;目录路径=会员/安全/&GT;
&LT; / secureWebPages&GT;
希望这有助于!
I want to use HTTPS in my ASP.NET web application, but only for the Login.aspx page.
How can this be accomplished?
First get or create a certificate
Get the SecureWebPageModule module from http://www.codeproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver. Instructions for setup can be found in the article.
Add secureWebPages tag to web.config
<configuration> ... <secureWebPages enabled="true"> ... </secureWebPages> ... <system.web> ... </system.web> </configuration>
Add files and directories to be use for https protocol:
<secureWebPages enabled="true"> <file path="Login.aspx" /> <file path="Admin/Calendar.aspx" ignore="True" /> <file path="Members/Users.aspx" /> <directory path="Admin" /> <directory path="Members/Secure" /> </secureWebPages>
Hope this helps!
这篇关于如何使用HTTPS在ASP.Net应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!