ASP.NET在web.config中的认证配置
2012年3月13日
5 条评论
ASP.NET支持在web.config中直接进行访问权限的管理,具体如下,以下是网站根目录下的web.config代码片段
<configuration> <location path="Styles/Site.css"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <system.web> <compilation debug="true" targetFramework="4.0" /> <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> <authorization> <allow users="maple,maple2"/> <deny users="*"/> </authorization> </configuration>
近期评论