asp.net2.0成员.角色.配置文件设置

1.<connectionStrings>节点
<connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=ZHANGCHENGXIANG\Sql2005;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
2.<system.web>节点
 <profile defaultProvider="SqlProfileProvider">
      <providers>
        <remove name="AspNetSqlProfileProvider"/>
        <add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider"
     connectionStringName="LocalSqlServer"/>
      </providers>
3. <membership>节点
 <membership>
      <providers>
        <remove name="AspNetSqlMembershipProvider"/>
        <add name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider,System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
          enablePasswordReset="true" requiresQuestionAndAnswer="true"
          applicationName="/test" requiresUniqueEmail="false"
          minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"
          passwordFormat="Hashed" maxInvalidPasswordAttempts="5"
          passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
      </providers>
    </membership>
4.<authentication >节点
 <authentication mode="Forms">
   <forms name=".ASPXUSERDEMO" loginUrl="Formslogin.aspx" protection="All" timeout="60" />
  </authentication>
  <authorization>
   <deny users="?" />
  </authorization>

未完待续

你可能感兴趣的:(asp.net)