ASP.NET MEMBERSHIP的XML配置
生活随笔
收集整理的這篇文章主要介紹了
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> 源碼文件:/Files/niunan/membership測試.7z
????<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> 源碼文件:/Files/niunan/membership測試.7z
轉載于:https://www.cnblogs.com/niunan/archive/2009/08/29/1556331.html
總結
以上是生活随笔為你收集整理的ASP.NET MEMBERSHIP的XML配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原神海螺屋雷神瞳怎么解密
- 下一篇: ASP.NET Session详解