Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.net Membership½ÇÉ«ÓëȨÏÞ¹ÜÀí(ת)

 
±¾ÎÄĿ¼£º
1.membership¼ò½é
2.membershipÔÚsql serverÖеÄÉèÖÃ
3.ÅäÖÃweb.config
4.´´½¨Óû§CreateUserWizard¿Ø¼þ
5.Óû§µÇ¼login¿Ø¼þ
6.ÏÔʾµ±Ç°Óû§µÄÃû³ÆLoginName¿Ø¼þ
7.¼ì²âÓû§µÄÉí·ÝÑé֤״̬µÄLoginStatus¿Ø¼þ
8.Ϊ²»Í¬Àà±ðÓû§³ÊÏÖ²»Í¬ÄÚÈݵÄLoginView¿Ø¼þ
9.¸ü¸ÄÃÜÂëµÄChangePassword¿Ø¼þ
10.×ÔÖúÕÒ»ØÃÜÂëµÄPasswordRecovery¿Ø¼þ
11.×ܽá
1.membership¼ò½é
membership£¬ÕæµÄºÜÓÐȤ£¬ºÜ·½±ã£¬ºÜÓÐÓ᣽éÉܸø´ó¼Ò¡£
ÔÚ ASP.NET Ó¦ÓóÌÐòÖУ¬Membership ÀàÓÃÓÚÑéÖ¤Óû§Æ¾¾Ý²¢¹ÜÀíÓû§ÉèÖã¨ÈçÃÜÂëºÍµç×ÓÓʼþµØÖ·£©¡£Membership
Àà¿ÉÒÔ¶À×ÔʹÓ㬻òÕßÓë FormsAuthentication Ò»ÆðʹÓã¬ÒÔ´´½¨Ò»¸öÍêÕûµÄ Web
Ó¦ÓóÌÐò»òÍøÕ¾µÄÓû§Éí·ÝÑé֤ϵͳ¡£Login ¿Ø¼þ·â×°ÁË Membership À࣬´Ó¶øÌṩһÖÖ±ã½ÝµÄÓû§ÑéÖ¤»úÖÆ¡£
Membership ÀàÌṩµÄ¹¦ÄÜ¿ÉÓÃÓÚ£º
1)´´½¨ÐÂÓû§¡£
2)½«³ÉÔ±×ʸñÐÅÏ¢£¨Óû§Ãû¡¢ÃÜÂë¡¢µç×ÓÓʼþµØÖ·¼°Ö§³ÖÊý¾Ý£©´æ´¢ÔÚ Microsoft SQL Server »òÆäËûÀàËƵÄÊý¾Ý´æ´¢Çø¡£
3)¶Ô·ÃÎÊÍøÕ¾µÄÓû§½øÐÐÉí·ÝÑéÖ¤¡£¿ÉÒÔÒÔ±à³Ì·½Ê½¶ÔÓû§½øÐÐÉí·ÝÑéÖ¤£¬Ò²¿ÉÒÔʹÓà Login ¿Ø¼þ´´½¨Ò»¸öÖ»ÐèºÜÉÙ´úÂë»òÎÞÐè´úÂëµÄÍêÕûµÄÉí·ÝÑé֤ϵͳ¡£
4)¹ÜÀíÃÜÂë¡£°üÀ¨´´½¨¡¢¸ü¸Ä¡¢¼ìË÷ºÍÖØÖÃÃÜÂëµÈµÈ¡£¿ÉÒÔÑ¡ÔñÅäÖà ASP.NET ³ÉÔ±×ʸñÒÔÒªÇóÒ»¸öÃÜÂëÌáʾÎÊÌâ¼°Æä´ð°¸À´¶ÔÍü¼ÇÃÜÂëµÄÓû§µÄÃÜÂëÖØÖúͼìË÷ÇëÇó½øÐÐÉí·ÝÑéÖ¤¡£
ĬÈÏÇé¿öÏ£¬ASP.NET ³ÉÔ±×ʸñ¿ÉÖ§³ÖËùÓÐ ASP.NET Ó¦ÓóÌÐò¡£Ä¬ÈϳÉÔ±×ʸñÌṩ³ÌÐòΪ SqlMembershipProvider
²¢ÔÚ¼ÆËã»úÅäÖÃÖÐÒÔÃû³Æ AspNetSqlProvider Ö¸¶¨¡£SqlMembershipProvider µÄĬÈÏʵÀýÅäÖÃΪÁ¬½Óµ½
Microsoft SQL Server µÄÒ»¸ö±¾µØʵÀý¡£
2.membershipÔÚsql serverÖеÄÉèÖÃ
ҪʹÓÃmembership£¬ÐèÒª¶ÔÊý¾Ý¿â½øÐÐһЩÉèÖã¬Ê¹ÓùýmembershipµÄÅóÓÑÖªµÀ£¬Êý¾Ý¿âÖÐÓÐһЩ¹ÌÓÐµÄ±í¡¢ÊÓͼºÍ´æ´¢¹ý³Ì£¬ÎÒÃÇ×Ô
¼ºµÄ±íÖÐûÓÐÕâЩ¶«Î÷¡£²»¹ý£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÏòµ¼À´´´½¨ËüÃÇ£¬ÄǾÍÊÇaspnet_regsql.exe£¬Ò»°ãÀ´ËµËüλÓÚ£ºC:\WINDOWS
\Microsoft.NET\Framework\v2.0.50727£¨ÎҵľÍÔÚÕâÀ
Ëü¼È¿ÉÒÔ´´½¨Êý¾Ý¿âÖеÄÑ¡ÏҲ¿ÉÒÔÒƳýÕâЩÉèÖá£
ÔÚÔËÐÐÕâ¸ö³ÌÐò֮ǰ£¬ÎÒÔÚsql server2005Öн¨Á¢ÁËÒ»¸ö¿ÕµÄÊý¾Ý¿â£ºmembershipdemo¡£½¨Á¢membershipdemoºó£¬ÎÒÃÇÔËÐÐaspnet_regsql.exe£¬Ö¸¶¨membershipΪmembershipdemo¡£
Íê³ÉÖ®ºó£¬¿Õ¿ÕµÄÊý¾Ý¿â¾ÍÓкܶàÄÚÈÝÁË£¬²»¹ý¾ßÌåµÄÄÚÈÝÔÝʱ²»±Ø¹Ü¡£¼ÌÐøºóÃæµÄÄÚÈÝ¡


Ïà¹ØÎĵµ£º

dz̸ASP.net°²È«±à³Ì

ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......

ASP.NET

ʾÀý
µÚÒ»¸öʾÀýÑÝʾÈçºÎ´´½¨ FileUpload ¿Ø¼þ£¬¸Ã¿Ø¼þ½«Îļþ±£´æµ½´úÂëÖÐÖ¸¶¨µÄ·¾¶¡£
<%@ Page Language="C#" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
  ......

ASP.NET

      HiddenField ¿Ø¼þÌṩÁËÒ»ÖÖÔÚÒ³ÃæÖд洢ÐÅÏ¢µ«²»ÏÔʾÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬¿ÉÒÔÔÚ HiddenField ¿Ø¼þÖд洢Óû§Ê×Ñ¡ÏîÉèÖã¬ÒÔ±ã¿ÉÒÔÔÚ¿Í»§¶Ë½Å±¾ÖжÁÈ¡´ËÉèÖá£ÈôÒª½«ÐÅÏ¢·ÅÈë HiddenField ¿Ø¼þÖУ¬ÇëÔÚÁ½´Î»Ø·¢Ö®¼ä½«Æä Value ÊôÐÔÉèÖÃΪҪ´æ´¢µÄÖµ¡£
 
Ò»¡¢¹¦ÄÜ
¿ÉÒÔʹÓà HiddenFi ......

asp.netʵÏÖα¾²Ì¬


webconfigα¾²Ì¬
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
</httpHandlers>
</system.web> ......

ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂëʵÏÖ

 Button±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElement;
var objs = document.getElement ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ