• ASP.NET MEMBERSHIP的XML配置


    做了一个MEMBERSHIP的测试,先记下来,以备后用!JAVAEYE网站是不是被人攻击了啊。。怎么打不开。。晕。。我有好多文章都在里面啊。。都没有备份的。。。
      <connectionStrings>
        
    <add name="conn" connectionString="server=.\sqlexpress;uid=sa;pwd=123456;database=test"/>
      
    </connectionStrings>
     
    <system.web>
     
    <!-- 开启角色管理 -->
        
    <roleManager enabled="true" />
        
    <!-- membership配置 -->
        
    <membership userIsOnlineTimeWindow="20">
          
    <providers>
            
    <remove name="AspNetSqlMembershipProvider" />
            
    <add connectionStringName="conn" enablePasswordRetrieval="false"
             enablePasswordReset
    ="true" requiresQuestionAndAnswer="true" applicationName="/"
             requiresUniqueEmail
    ="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength
    ="6" minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow
    ="10" passwordStrengthRegularExpression=""
             name
    ="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          
    </providers>
        
    </membership>
        
    <!-- 启用匿名用户-->
        
    <anonymousIdentification
      enabled
    ="true"
      cookieName
    =".AnonymousUser"
      cookieTimeout
    ="60"
      cookiePath
    ="/"
      cookieRequireSSL
    ="false"
      cookieSlidingExpiration
    ="true"
      cookieProtection
    ="Validation"
      cookieless
    ="UseCookies"
         
    />

        
    <!--  第一个Profile设置,可用中文,推荐英文 -->
        
    <profile automaticSaveEnabled="true" enabled="true" defaultProvider="MembershipTest">
          
    <providers>
            
    <add name="MembershipTest" connectionStringName="conn" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          
    </providers>
          
    <properties>
            
    <add name="性别" type="System.String" allowAnonymous="true" />
            
    <add name="生日" type="System.DateTime" allowAnonymous="true" />
            
    <add name="星座" type="System.String" allowAnonymous="true" />
            
    <group name="地址">
              
    <add name="国家" defaultValue="中国" type="System.String" allowAnonymous="true" />
              
    <add name="城市" type="System.String" allowAnonymous="true" />
              
    <add name="邮编" type="System.Int32" allowAnonymous="true" />
            
    </group>
          
    </properties>
        
    </profile>
        
    <!--
                通过 
    <authentication> 节可以配置 ASP.NET 用来 
                识别进入用户的
                安全身份验证模式。 
            
    -->
        
    <authentication mode="Forms">
          
    <forms name="myAuthentication" loginUrl="Login.aspx" timeout="60" />
        
    </authentication>
        
    <!--
                如果在执行请求的过程中出现未处理的错误,
                则通过 
    <customErrors> 节可以配置相应的处理步骤。具体说来,
                开发人员通过该节可以配置
                要显示的 html 错误页
                以代替错误堆栈跟踪。

            
    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                
    <error statusCode="403" redirect="NoAccess.htm" />
                
    <error statusCode="404" redirect="FileNotFound.htm" />
            
    </customErrors>
            
    -->
      
    </system.web>
    撸码:复制、粘贴,拿起键盘就是“干”!!!
  • 相关阅读:
    海量文档查同或聚类问题 Locality Sensitive Hash 算法
    Python之道 (大道至简)
    Inside C++ object Model构造函数
    Python标准模块logging
    Inside C++ object Model多态(ObjectOriented)
    应用Notepad++的正则表达式完成较复杂替换的一个小例子
    维护FAST可用的一些命令 持续更新
    SharePoint List的List Template ID明细表
    SharePoint 2010 Incoming Email怎么配?
    使用ContentDeploymentJob.AddQuickDeployObject的时候, 请注意第三个参数一定要使用Server Relative URL
  • 原文地址:https://www.cnblogs.com/niunan/p/1556331.html
Copyright © 2020-2023  润新知