當(dāng)前位置:
首頁(yè) >
ASP.NET MEMBERSHIP的XML配置
發(fā)布時(shí)間:2023/12/1
37
豆豆
生活随笔
收集整理的這篇文章主要介紹了
ASP.NET MEMBERSHIP的XML配置
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
做了一個(gè)MEMBERSHIP的測(cè)試,先記下來,以備后用!JAVAEYE網(wǎng)站是不是被人攻擊了啊。。怎么打不開。。暈。。我有好多文章都在里面啊。。都沒有備份的。。。 ??<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"
?????/>
????<!--??第一個(gè)Profile設(shè)置,可用中文,推薦英文?-->
????<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="國(guó)家"?defaultValue="中國(guó)"?type="System.String"?allowAnonymous="true"?/>
??????????<add?name="城市"?type="System.String"?allowAnonymous="true"?/>
??????????<add?name="郵編"?type="System.Int32"?allowAnonymous="true"?/>
????????</group>
??????</properties>
????</profile>
????<!--
????????????通過?<authentication>?節(jié)可以配置?ASP.NET?用來?
????????????識(shí)別進(jìn)入用戶的
????????????安全身份驗(yàn)證模式。?
????????-->
????<authentication?mode="Forms">
??????<forms?name="myAuthentication"?loginUrl="Login.aspx"?timeout="60"?/>
????</authentication>
????<!--
????????????如果在執(zhí)行請(qǐng)求的過程中出現(xiàn)未處理的錯(cuò)誤,
????????????則通過?<customErrors>?節(jié)可以配置相應(yīng)的處理步驟。具體說來,
????????????開發(fā)人員通過該節(jié)可以配置
????????????要顯示的?html?錯(cuò)誤頁(yè)
????????????以代替錯(cuò)誤堆棧跟蹤。
????????<customErrors?mode="RemoteOnly"?defaultRedirect="GenericErrorPage.htm">
????????????<error?statusCode="403"?redirect="NoAccess.htm"?/>
????????????<error?statusCode="404"?redirect="FileNotFound.htm"?/>
????????</customErrors>
????????-->
??</system.web> 源碼文件:/Files/niunan/membership測(cè)試.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"
?????/>
????<!--??第一個(gè)Profile設(shè)置,可用中文,推薦英文?-->
????<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="國(guó)家"?defaultValue="中國(guó)"?type="System.String"?allowAnonymous="true"?/>
??????????<add?name="城市"?type="System.String"?allowAnonymous="true"?/>
??????????<add?name="郵編"?type="System.Int32"?allowAnonymous="true"?/>
????????</group>
??????</properties>
????</profile>
????<!--
????????????通過?<authentication>?節(jié)可以配置?ASP.NET?用來?
????????????識(shí)別進(jìn)入用戶的
????????????安全身份驗(yàn)證模式。?
????????-->
????<authentication?mode="Forms">
??????<forms?name="myAuthentication"?loginUrl="Login.aspx"?timeout="60"?/>
????</authentication>
????<!--
????????????如果在執(zhí)行請(qǐng)求的過程中出現(xiàn)未處理的錯(cuò)誤,
????????????則通過?<customErrors>?節(jié)可以配置相應(yīng)的處理步驟。具體說來,
????????????開發(fā)人員通過該節(jié)可以配置
????????????要顯示的?html?錯(cuò)誤頁(yè)
????????????以代替錯(cuò)誤堆棧跟蹤。
????????<customErrors?mode="RemoteOnly"?defaultRedirect="GenericErrorPage.htm">
????????????<error?statusCode="403"?redirect="NoAccess.htm"?/>
????????????<error?statusCode="404"?redirect="FileNotFound.htm"?/>
????????</customErrors>
????????-->
??</system.web> 源碼文件:/Files/niunan/membership測(cè)試.7z
轉(zhuǎn)載于:https://www.cnblogs.com/niunan/archive/2009/08/29/1556331.html
總結(jié)
以上是生活随笔為你收集整理的ASP.NET MEMBERSHIP的XML配置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原神海螺屋雷神瞳怎么解密
- 下一篇: ASP.NET Session详解