Asp.NetÈÏÖ¤ºÍÊÚȨÀ©Õ¹
ÔÀ´µÄMembership
ÎÒÃÇÖªµÀÔÚAsp.Net 2.0ÖÐ΢Èí¾ÍΪÎÒÃÇÌṩÁËÇ¿´óµÄȨÏÞ¹ÜÀí¹¦ÄÜÀ´°ïÖúÎÒÃǹÜÀíAsp.NetÏàÓ¦µÄȨÏÞ£¬ÆäʵËüÊǶÔÎÒÃǵÄÉí·ÝÈÏÖ¤ºÍȨÏÞ¹ÜÀíµÄÒ»ÖÖ³éÏó¡£ÕâÀï¼òµ¥µÄÁ˽âÒ»ÏÂMembership£º
ÎÒÃÇÓ¦¸ÃÖªµÀ΢Èí¹ØÓÚÈÏÖ¤·½Ãæ¸øÎÒÃÇÌṩÁËÈýÖÖÈÏÖ¤·½Ê½windows ¡¢Forms¡¢Passport,ÎÒÏëÊìϤAsp.NetµÄÓû§¶¼ÖªµÀÎÒÃÇʹÓÃFormsÈÏÖ¤Ó¦¸ÃÊÇ×î¶àµÄ¡£µ«ÊÇÓ¦¸ÃÖ¸³öµÄ¾ÍÊÇÕâЩֻÊÇÉí·ÝÈÏÖ¤·½ÃæµÄ£¬ºÍMembership³ÉÔ±¹ÜÀíÊÇ·Ö¿ªµÄ¶ø²»ÊÇÎÒÃÇÒªÓÃFormsÈÏÖ¤¾Í±ØÐëʹÓÃMembership¡£ÀýÈç¼ÙÉèÎÒÃǵÄÕ¾µãֻǣ³¶µ½Óû§µÄµÇ¼¶ø²»ÐèÒª½øÐÐÏàÓ¦µÄ½ÇÉ«»®·ÖÒÔ¼°Ê¹ÓÃMembership´´½¨Óû§µÈ·½·¨µÄ»°¾ÍÍêȫֻʹÓÃFormsÈÏÖ¤¾Í¿ÉÒÔÁË£¨ÏñֻʹÓÃFormsÈÏÖ¤µÄÇé¿ö£¬ÎÒÃÇÓû§×¢²á£¬Óû§Éí·ÝÈÏÖ¤¾Í±ØÐëÎÒÃÇ×Ô¼ºÀ´×öÁË¡£ÎÒÃÇ¿ÉÒÔ½¨Á¢Óû§±í£¬×¢²áµÄʱºòÖ»ÐèҪдÏàÓ¦µÄÓû§ÐÅÏ¢µ½±íÖУ¬µÇ¼µÄʱºò¶ÁÈ¡Êý¾Ý¿âÖÐÏàÓ¦µÄÐÅÏ¢×öÆ¥Å䣬Èç¹ûÕýÈ·¾ÍÖ´ÐÐFormsAuthentication.SetAuthCookie(UserName, false)¾Í¿ÉÒÔÁË£©¡£ÕâʱÎÒÃÇËùÓеÄÓû§ÐÅÏ¢¹ÜÀí¶¼ÊÇ×Ô¼ºÀ´×öµÄ£¬µ±È»Áé»îÐԺܸßÁË£¬ÎÒÃǽö½öÓõ½FormsÈÏÖ¤µÄ»ù±¾¹¦ÄÜ£¨ÏñûÓеǼ×Ô¶¯»Øµ½µÇ¼ҳÃæ¡¢µÇ¼֮ºó¿ÉÒÔÔÚÆäËûÈκÎλÖõõ½Óû§Ïà¹ØÐÅÏ¢µÈ£©¡£µ«ÊÇÈç¹ûÓû§ÈÏΪ×Ô¼º¹ÜÀíÕâЩÐÅÏ¢±È½ÏÂé·³£¬¶øÇÒÓÐʱºòÎÒÐèÒªÓõ½½ÇÉ«¹ÜÀíµÄ»°ÎÒÃǾͲ»µÃ²»Ìáµ½MembershipÁË£¬ÓÐÁËËüÕû¸öÉí·ÝÈÏÖ¤ºÍȨÏÞ¹ÜÀí¾ÍºÜÈÝÒ×ÁË¡£ÕâÀï˵һÏÂËüµÄ±¾ÖÊ£¬MembershipÖ®ËùÒÔÈÃÓû§ÄÇôËæÐÄËùÓûµÄ²Ù×÷¶ø²»ÐèдºÜ¶àµÄ´úÂëÊÇÒòΪËü±¾Ê¡×öÁË´óÁ¿µÄ·â×°£¬ºÜ¶àÈ˲»Ã÷°×Óû§ÐÅÏ¢´æ´¢ÔÚʲôµØ·½£¬ÆäʵËüÊÇ´æ´¢µ½ÁËASPNETDB.mdfÕâ¸öÊý¾Ý¿âÖС£Õâʱ³õѧÕß¾ÍÒÉÎÊÕâ¸öÊý¾Ý¿âÎÒûÓн¨Á¢°¡£¬¶øÇÒÎÒÔÚ´´½¨¹¤³ÌµÄʱºòҲû¿´µ½Õâ¸öÊý¾Ý¿â°¡£¬¿öÇÒÊý¾Ý¿âÁ¬½Ó×Ö·û´®ÔÚʲôµØ·½°¡£¿Õâ¸öÊý¾Ý¿âÊÇϵͳ×Ô¶¯½¨Á¢µÄ£¬ÊÇ×Ô¶¯¸½¼ÓµÄ£¬µ±Ê¹ÓÃMembershipÀàʱ×Ô¶¯´´½¨·ÅÔÚApp_DataÎļþ¼ÐµÄ£¬ÏµÍ³¸Õ¿ªÊ¼´´½¨Ê±ÓÉÓÚϵͳ²»ÖªµÀÊÇ·ñʹÓÃMembershipËùÒԿ϶¨µ±Ê±Ã»Óд´½¨£¬¶øÇÒÊý¾Ý¿âÁ¬½Ó×Ö·û´®ÊDZØÐëµÄ¿Ï¶¨Óеģ¬ËüÔÚMachine.configÖУ¬Õâ¸öÎļþ¾ßÌå×÷ÓÃÎÒÏë´ó¼ÒÓ¦¸Ã¿´¿´asp.netÔËÐлúÖƾÍÖªµÀÁË£¬ËüÊÇÓÅÏÈÓÚweb.configµÄÒ»¸öÅäÖÃÎļþ¡£MembershipÌṩÁË´´½¨Óû§¡¢µÃµ½Óû§¡¢É¾³ýÓû§¡¢ÑéÖ¤Óû§µÈһϵÁеŦÄÜ£¬¶øÇÒÓëRole½ôÃܽáºÏ¹ÜÀíÓû§½ÇÉ«¡£³ý´ËÖ®Íâ΢Èí»¹ÌṩÁËÏàÓ¦µÄ¿Ø¼þʹÓû§¸ü¼ÓÈÝÒ×µÄʹÓÃMembership¡£
MembershipÀ©Õ¹
MembershipÄÇôºÃ£¬ÎÒÃǶ¼ÓÃËü²»¾ÍÐ
Ïà¹ØÎĵµ£º
¹ØÓÚ&¡¢Ë«ÒýºÅ¡¢ºÍµ¥ÒýºÅµÄ½âÊÍ
ÏÂÃæÏȼòµ¥µØ˵һÏÂËûÃǵÄÒâÒå¡£
£¨1£©&ÊÇÁ¬½ÓÔËËã·û£¬Ëü¿ÉÒÔ½«Á½¸ö×Ö·û´®Á¬½Ó³ÉÒ»¸ö×Ö·û´®¡£Èç
a="abc" & "def"
Ö´ÐÐÁ¬½ÓÔËËãºó£¬a="abcdef ......
asp.netÖе¼³öÓкܶ෽·¨¡£ÆäÖбȽÏÍƼöµÄ¼æÈݵ¼³öÊǵ¼³öΪword/excel¼æÈݵÄmhtml¸ñʽ²¢ÉèÖÃÁ÷¸ñʽΪword»òexcel¡£
ÕâÖз½·¨µÄºÃ´¦ÊÇ¿ÉÒÔ½¨Á¢Ò»¸öͨÓõĿ⡣±¾ÎÄÖÐÌá³öÁËÒ»¸öͨÓõĵ¼³öÀ࣬ʵ¼ùÖÐʹÓÃЧ¹û½ÏºÃ¡££¨ps£¬html½âÎöÀàдµÄ±È½Ï²Ö´Ù£¬¸÷λÈçÓÐÐËȤ¿ÉÖØдһÏÂ~£©
///
///@Author Simsure
///@Version 1.0
///
......
1.//µ¯³ö¶Ô»°¿ò.µã»÷תÏòÖ¸¶¨Ò³Ãæ
Response.Write("<script>window.alert('¸Ã»áԱûÓÐÌá½»ÉêÇë,ÇëÖØÐÂÌá½»£¡')</script>");
Response.Write("<script>window.location ='http://www.cgy.cn/bizpulic/upmeb.aspx'</script>");
2.//µ¯³ö¶Ô»°¿ò
Response.Write("<scr ......
ÔÚÈÕ³£Ñ§Ï°ºÍʹÓÃASP.NETµÄ¹ý³ÌÖУ¬ÓÐЩ±È½ÏÌØÊâÓÐÓõľÑéÊÕ¼¯ÔÚÕâÀ·½±ã×Ô¼º¼ÇÒäºÍÀí½â£¬Ò²Ï£ÍûÄÜ°ïÖúµ½Ò»Ð©³õѧÕ߲ο¼¡£Èç¹ûÓÐЩ²»×ãµÄµØ·½Ï£Íû¸ßÊÖ²»Áߴͽ̣¡£¡£¡
Ò»¡¢ÔÚÒ»°ã´¦ÀíÎļþ(ashx)ÖÐʹÓÃSessionʱ£¬ÐèÒªÒý½øÃüÃû¿Õ¼ä£ºusing System.Web.SessionState; ²¢ÇÒʹ¸ÃÀàÊµÏ ......