ASP.NET 2.0 ʹÓÃMembership
1. ÔÚsql serverÖеÄÉèÖÃ
¡¡¡¡ÔËÐÐaspnet_regsql.exe,Ò»°ãÀ´ËµËüλÓÚ£ºC:\WINDOWS \Microsoft.NET\Framework\v2.0.50727
¡¡¡¡ÀýÈ磺aspnet_regsql.exe -S [·þÎñÆ÷] -U [Óû§Ãû] -P [Óû§ÃÜÂë]-A all -d [Êý¾Ý¿âÃû³Æ]
¡¡¡¡ ´Ë·½·¨Ê¹Óúó»áÔÚÖ¸¶¨Êý¾Ý¿âÉú³É¼¸¸ö±í£¬»¹´æ´¢¹ý³ÌÒ²ÊÓͼ£¬ÈçÏ£º
¡¡¡¡
2.ÅäÖÃweb.config
¡¡membership¼ÈÈ»ÊÇÓÃÓÚ³ÉÔ±×ʸñ¹ÜÀí£¬µ±È»ÒªÇóµÇ¼ÑéÖ¤Éí·Ý£¬ËùÒÔÊ×ÏȼÓÉÏÒ»¸öformsÑéÖ¤¡£
<authentication mode="Forms"> <forms loginUrl="login.aspx" name=".aspxlogin"/> </authentication>ͬÑùÔÚsystem.web½ÚµãÏÂÌí¼Ómembership½Úµã¡£
<connectionStrings> <add name="SqlServices" connectionString="Data Source=MySqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" /> </connectionStrings> <system.web> <membership defaultProvider="SqlServices" userIsOnlineTimeWindow="15" hashAlgorithmType=""> <!--defaultProvider £ºÌṩ³ÌÐòµÄÃû³Æ¡£Ä¬ÈÏΪ AspNetSqlMembershipProvider¡£Èç¹ûÄãÓжà¸öProviderµÄ»°£¬Ö¸¶¨Ò»¸öĬÈÏÖµÊÇÃ÷ÖǵÄ×ö·¨--> <!--userIsOnlineTimeWindow £ºÖ¸¶¨Óû§ÔÚ×î½üÒ»´Î»î¶¯µÄÈÕÆÚ/ʱ¼ä´ÁÖ®ºó±»ÊÓΪÁª»úµÄ·ÖÖÓÊý¡£--> <!--hashAlgorithmType £ºÓÃÓÚ¹þÏ£ÃÜÂëµÄËã·¨µÄ±êʶ·û£¬»òΪ¿ÕÒÔʹÓÃĬÈϹþÏ£Ëã·¨¡£--> <providers> <clear/> <add connectionStringName="SqlServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> <!--connectionStringName £ºmembershipÊý¾Ý¿âµÄÁ¬½ÓÃû³Æ¡£--> <!--enablePasswordRetrieval £ºÖ¸Ê¾µ±Ç°³ÉÔ±×ʸñÌṩ³ÌÐòÊÇ·ñÅäÖÃΪÔÊÐíÓû§¼ìË÷ÆäÃÜÂë¡£--> <!--enablePasswordReset £ºÖ¸Ê¾µ±Ç°³ÉÔ±×ʸñÌṩ³ÌÐòÊÇ·ñÅäÖÃΪÔÊÐíÓû§ÖØÖÃÆäÃÜÂë¡£--> <!--requiresQuestionAndAnswer £ºÖ¸Ê¾Ä¬ÈϳÉÔ±×ʸñÌṩ³ÌÐòÊÇ·ñÒªÇóÓû§ÔÚ½øÐÐÃÜÂëÖØÖúͼìË÷ʱ»Ø´ðÃÜÂëÌáʾÎÊÌâ¡£--> <!--applicationName £ºÓ¦ÓóÌÐòµÄÃû³Æ¡£--> <!--requiresUniqueEmail £ºÖ¸Ê¾³ÉÔ±×ʸñÌṩ³ÌÐòÊÇ·ñÅäÖÃΪҪÇóÿ¸öÓû§Ãû¾ßÓÐΨһµÄµç×ÓÓʼþµØÖ·¡£--> <!--passwordFormat £ºÖ¸Ê¾ÔÚ³ÉÔ±×ʸñÊý¾Ý´æ´¢ÇøÖд洢ÃÜÂëµÄ¸ñʽ¡£Öµ¿ÉÑ¡Clear¡¢Encrypted ºÍ Hashed¡£Clear ÃÜÂëÒÔÃ÷ÎÄÐÎʽ´æ´¢£¬Õâ¿ÉÒÔÌá¸ß´æ´¢ºÍ¼ìË÷ÃÜÂëµÄÐÔÄÜ£¬µ«°²È«ÐԽϲµ±Êý¾ÝÔ´°²È«ÐÔÊܵ½Íþвʱ´ËÀàÃÜÂëºÜÈÝÒ×±»¶ÁÈ¡¡£Encrypted ÃÜÂëÔڴ洢ʱ½øÐÐÁ˼ÓÃÜ£¬¿ÉÒÔÔڱȽϻò¼ìË÷ÃÜÂëʱ½øÐнâÃÜ¡£´ËÀàÃÜÂëÔÚ´æ´¢ºÍ¼ìË÷ʱÐèÒª½øÐжîÍâµÄ´¦Àí£¬µ«±È½Ï°²È«£¬ÔÚÊý¾ÝÔ´µÄ°²È«ÐÔÊܵ½Íþвʱ²»ÈÝÒ×±»»ñÈ¡¡£Hashed ÃÜÂëÔÚ´æ´¢µ½Êý¾Ý¿âʱʹÓõ¥Ïò¹þÏ£Ëã·¨ºÍËæ»úÉú³ÉµÄ salt Öµ½øÐйþÏ£´¦Àí¡£ÔÚÑé֤ijһÃÜÂëʱ£¬½«ÓÃÊý¾Ý¿âÖÐµÄ salt Öµ¶Ô¸ÃÃÜÂë½øÐйþÏ£¼ÆËãÒÔ½øÐÐÑéÖ¤¡£ÎÞ·¨¼ìË÷¹þÏ£ÃÜÂë¡£--> <!--maxInvalidPasswordAttempts £ºËø¶¨³ÉÔ±×ʸñÓû§Ç°ÔÊÐíµÄÎÞЧÃÜÂë»òÎÞЧÃÜÂëÌáʾÎÊÌâ´ð°¸³¢ÊÔ´ÎÊý¡£--> <!--minRequiredPasswordLength £ºÃÜÂëËùÒªÇóµÄ×îС³¤¶È¡£--> <!--minRequiredNonalphanumericCharacters £ºÓÐЧÃÜÂëÖбØÐë°üº¬µÄ×îÉÙÌØÊâ×Ö·ûÊý¡£--> <!--passwordAttemptWindow £ºÔÚËø¶¨³ÉÔ±×ʸñÓû§Ö®Ç°ÔÊÐíµÄ×î´óÎÞЧÃÜÂë»òÎÞЧÃÜÂëÌáʾÎÊÌâ´ð°¸³¢ÊÔ´ÎÊýµÄ·ÖÖÓÊý¡£ÕâÊÇΪÁË ·ÀÖ¹²»Ã÷À´Ô´·´¸´³¢ÊÔÀ´²Â²â³ÉÔ±×ʸñÓû§µÄÃÜÂë»òÃÜÂëÌáʾÎÊÌâ´ð°¸µÄ¶îÍâ´ëÊ©¡£--> <!--passwordStrengthRegularExpression £º¼ÆËãÃÜÂëµÄÕýÔò±í´ïʽ¡£--> </providers> </membership> </system.web>ΪmembershipÅäÖÃweb.configºó£¬ÔÙÅäÖÃÆä½ÇÉ«¹ÜÀíroleManager£¬Ò²ÊÇÔÚsystem.webÏ¡£
<roleManager defaultProvider="SqlProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" > <providers> <add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="SqlServices" applicationName="SampleApplication" /> </providers> </roleManager>
ÍƼöÐÅÏ¢
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- Asp.net MVCÔ´Âë·ÖÎö--Model Validation(Se....
- .Net À¬»ø»ØÊÕ»úÖÆÔÀíºÍËã·¨£¨Ò»£©
- .netʵÌåнâ
- ·ÖÎöASP.NET¶ÁÈ¡XMLÎļþ4ÖÖ·½·¨
- »ñÈ¡ÍøÕ¾ËõÂÔͼ´úÂë
- Asp.net ¸ù¾ÝIPµØÖ·»ñÈ¡¿çÍø¶ÎmacµØÖ·º¯Êý¡¾ËѲء¿
- ¹ýÂËÃô¸Ð¹Ø¼ü×Ö¡£
- Éú³ÉÖ¸¶¨Î»ÊýµÄËæ»ú×Ö·û´®
- ¿Í»§¶Ë»ñÈ¡MACµØÖ·£¬µ½·þÎñÆ÷ÑéÖ¤
- ²½²½ÎªÓª .NETÈý²ã¼Ü¹¹½âÎö ¶þ¡¢Êý¾Ý¿âÉè¼Æ
ÆÀÂÛ