如何在 ASP.Net 应用程序中使用 HTTPS [英] How to use HTTPS in an ASP.Net Application
问题描述
我想在我的 ASP.NET Web 应用程序中使用 HTTPS,但仅用于 Login.aspx 页面.
如何实现?
首先获取或创建证书
从 http://www 获取 SecureWebPageModule 模块.codeproject.com/Articles/7206/Switching-Between-HTTP-and-HTTPS-Automatically-Ver.可以在文章中找到设置说明.
在 web.config 中添加 secureWebPages 标签
<预><代码><配置>...<secureWebPages enabled="true">...</secureWebPages>...<system.web>...</system.web></配置>添加用于 https 协议的文件和目录:
<文件路径=登录.aspx"/><file path="Admin/Calendar.aspx" ignore="True"/><文件路径="Members/Users.aspx"/><目录路径=管理员"/><目录路径=成员/安全"/></secureWebPages>
希望这有帮助!
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!
这篇关于如何在 ASP.Net 应用程序中使用 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!