登录会员.NET [英] Login Membership .NET

查看:137
本文介绍了登录会员.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想知道什么是强制用户在一个网站到时,在.net中登录的最佳途径。我已经设置了会员功能,我想知道的是,以确保无论用户到达哪个地址的最佳方式,他们必须首先获得过程使用到他们请求的页面之前进行身份验证。任何资源将是巨大的,谢谢。

Hi I was wondering what is the best way to force the user to login when arriving at a website, in .net. I have set up the Membership features and I was wondering what is the best way to ensure that no matter what address the user arrives at, they must first get authenticated before proceding to the page they requested. Any resources will be great, thanks.

推荐答案

阿尔特的Web.config 在应用程序根目录为:

Alter Web.config in application root to read:

<authentication mode="forms">
   <forms loginUrl="Login.aspx" defaultUrl="/" />
</authentication>
<authorization>
   <deny users="?" />
   <allow users="*" />
</authorization>

边注的:很明显,ASP.NET只能保护那些流传ASP.NET引擎的请求。默认情况下,它不能强制对静态资源的安全性在IIS经典模式。在这种情况下,控制访问静态资源,就应该明确地映射到ASP.NET ISAPI DLL在IIS配置。

Side note: Obviously, ASP.NET can only protect the requests that are handed down to ASP.NET engine. By default, it cannot enforce the security on static resources in IIS classic mode. In that case, to control access to static resources, they should be explicitly mapped to the ASP.NET ISAPI DLL in the IIS configuration.

有关授权在此处了解详情: ASP.NET授权

More info about Authorization here: ASP.NET Authorization.

这篇关于登录会员.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆