转载自:http://www.cnblogs.com/webabcd/archive/2007/02/21/653508.html

 

介绍

现在 ASP.NET 2.0 提供了对成员资格(用户名/密码凭据存储)和角色管理服务的内置支持。由于所有这些服务都是提供程序驱动的(Provider),因此可以方便地用您自己的自定义实现替换。

关键

1、基于Windows的身份验证将<system.web>元素下的<authentication> 设置为 Windows;基于Forms的身份验证将<system.web>元素下的<authentication> 设置为 Forms。

2、基于Forms的身份验证时,设置<system.web>元素下的<authentication> 元素的 <forms> 子元素,示例如下,仅为说明

<authentication mode="Forms">

<forms name=".VS2005_Form" loginUrl="~/Security/Login.aspx" defaultUrl="~/Default.aspx"
protection
="All" timeout="30" path="/" requireSSL="false"
slidingExpiration
="true" enableCrossAppRedirects="false"
cookieless
="UseDeviceProfile">
</forms>

</authentication>

相关文章: