asp.net Éí·ÝÑéÖ¤£¨×î¼òµ¥Æª£©
ÔÚ´´½¨ÍøÕ¾ÖУ¬³£³£»áʹÓõ½Éí·ÝÑéÖ¤¡£asp.netÖÐÄÚÖÃÁ˼¸ÖÖÉí·ÝÑéÖ¤µÄ·½Ê½£¬ÈçWindows¡¢froms¡¢PassportµÈ¡£Õ⼸ÖÖÉí·ÝÑéÖ¤µÄ·½Ê½¸÷Óв»Í¬¡£
Ò»°ãÀ´Ëµ£¬ÍøÕ¾µÄÉí·ÝÑéÖ¤·½Ê½¶¼»á¾¹ýÒÔϼ¸¸ö²½Ö裺
1¡¢ÊäÈëÓû§ÃûºÍÃÜÂ룬µ¥»÷È·¶¨°´Å¥¡£
2¡¢ÔÚºǫ́ÅжÏÓû§ÃûºÍÃÜÂëÊÇ·ñÕýÈ·£¬Èç¹û´íÎó·µ»ØÌáʾ£»Èç¹ûÕýÈ·£¬½øÈë¿É·ÃÎʵÄÒ³Ãæ¡£
ÔÚASPʱ´ú£¬Í¨³£¶¼»áÔÚÑéÖ¤Óû§ÃûºÍÃÜÂëÊÇ·ñÆ¥ÅäÖ®ºó£¬´´½¨Ò»¸öSession£¬È»ºóÔÚÿ¸öÐèÒªÑéÖ¤µÄÒ³ÃæÖÐÅжÏSessionÊÇ·ñ´æÔÚ£¬Èç¹û´æÔÚ£¬ÔòÏÔʾҳÃæÄÚÈÝ£»Èç¹û²»´æÔÚ£¬²úÉúÌáʾ£¬²¢Ìøתµ½µÇ¼ҳÃæ¡£
µ«ÊÇ£¬ÔÚasp.netʱ´ú£¬Õâ¸ö¹ý³Ì¾Í¸ø´ó´óµÄ¼õ»¯ÁË£¬²»ÔÙÐèÒªÔÚÿ¸öÐèÒªÑéÖ¤µÄÒ³ÃæÖÐȥУÑéSession£¬Ö»ÐèÒª½øÐÐÈçϼ¸²½£¬¾Í¿ÉÒÔÍê³ÉÉí·ÝÑéÖ¤¹ý³Ì¡£
µÚÒ»²½£ºÐÞ¸Äweb.configÎļþ¡£
1¡¢ÔÚ<system.web>ºÍ</system.web>ÖÐÕÒµ½<authentication>½Ú£¬½«Æä¸ÄΪ“<authentication mode="Forms" />”£¬ÆäÖÐForms´ú±íʹÓÃ±íµ¥ÈÏÖ¤¡£
2¡¢<system.web>ºÍ</system.web>ÖÐÌí¼Ó“<authorization><deny users="?"/></authorization>”£¬ÆäÖГ<deny users="?"/>”´ú±í¾Ü¾øËùÓеÄÄäÃûÓû§¡£
µÚ¶þ²½£º´´½¨login.aspxÎļþ¡£
ÔÚ¾¹ýµÚÒ»²½Ö®ºó£¬ÎÞÂÛÓû§·ÃÎÊÍøÕ¾ÖеÄÄĸöÎļþ£¬Ö»ÒªÃ»Óо¹ýÉí·ÝÑéÖ¤£¬asp.net»á×Ô¶¯Ìøתµ½login.aspxÍøÒ³ÉÏ£¬²¢ÇÒÔÚURLÖÐʹÓÃReturnUrl²ÎÊýÀ´´«µÝÓû§µ±Ç°·ÃÎʵÄÍøÒ³¡£
¼ÙÉèÓû§Ã»Óо¹ýÉí·ÝÑéÖ¤¾ÍÖ±½Ó·ÃÎÊtest.aspxÎļþ£¬ÄÇôasp.net»á×Ô¶¯ÌøתÁËlogin.aspxÍøÒ³£¬´Ëʱä¯ÀÀÆ÷´°¿ÚÖеĵØÖ·À¸ÖеÄURLΪ£º“login.aspx?ReturnUrl=%2ftest.aspx”£¬Òò´Ë£¬¿ÉÒÔÔÚÉí·ÝÑé֤ͨ¹ýºó£¬ÔÙ½«ÍøÒ³Ìø»Øµ½ReturnUrl²ÎÊýÖ¸¶¨µÄÍøÒ³ÉÏÈ¥¡£
µÚÈý²½£ºÔÚlogin.aspxÎļþÖÐÑéÖ¤Éí·Ý¡£
Éí·ÝÑéÖ¤·½Ê½±È½Ï¼òµ¥£¬Ò»°ã¶¼ÊÇ´´½¨Ò»¸öÎı¾¿òºÍÒ»¸öÃÜÂë¿ò£¬Óû§ÊäÈëÓû§ÃûºÍÃÜÂëºó£¬µ¥»÷Ìá½»°´Å¥£¬ÔòÈ¥Êý¾Ý¿âÖÐÑéÖ¤Éí·Ý£¬Ïêϸ¹ý³Ì¾Í²»Ð´ÁË£¬ÔÚ´ËÖ»ÒªÊäÈëµÄÓû§ÃûΪ1£¬ÃÜÂëΪ2¾ÍÈÏΪÉí·ÝÑé֤ͨ¹ý¡£
Éí·ÝÑéÖ¤Íê±ÏÖ®ºó£¬Ê¹ÓÃFormsAuthentication.SetAuthCookie()ΪÓû§´´½¨Ò»¸öÉí·ÝÑéÖ¤µÄƱ¾Ý£¬²¢½«ÆäÌí¼Óµ½CookieÖС£ÒÔºó£¬ÔÙ·ÃÎÊÍøÕ¾ÖеÄÆäËûÍøÒ³£¬¾Í²»ÐèҪʹÓýøÐÐÉí·ÝÑéÖ¤ÁË¡£µ¥»÷Ìá½»°´Å¥ºóµÄ´úÂëÈçÏÂËùʾ¡£
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
protected void Button1_Click(object sender, EventArgs e)
{
//Éí·ÝÑéÖ¤·½Ê½£¬±¾À
Ïà¹ØÎĵµ£º
ÍøÕ¾ÖÐä¯ÀÀÆ÷»º´æµÄ¿ØÖÆ(IIS+ASP.Net)
ÔÚIIS6.0 + Windows Server 2003ͨ¹ý²âÊÔ¡£ÈçÓдíÎó¾´ÇëÖ¸Õý¡£
1¡¢ IIS¿ØÖÆ£¨¶ÔJsµÈÎļþ£©£º
ÔÚIIS¹ÜÀíÆ÷Öв鿴ÎļþÊôÐÔ£¬ÔÚHTTPÍ·µÄTabÒ³ÖУ¬ÉèÖÓÆôÓÃÄÚÈݹýÆÚ”¡£
l IISÄ¬È ......
WSDL£ºÊÇÒ»¸öÓÃÀ´ÃèÊöWeb·þÎñºÍ˵Ã÷ÈçºÎÓëWeb·þÎñͨÐŵÄXMLÓïÑÔ¡£ ÔõÑùÏò±ðÈ˽éÉÜÄãµÄWeb serviceÓÐʲô¹¦ÄÜ£¬ÒÔ¼°Ã¿¸öº¯Êýµ÷ÓÃʱµÄ²ÎÊýµÈµÈ¡£
web·þÎñ£º½øÐÐwebÉÏÊý¾Ý½»»»µÄ·½·¨¡£Äܹ»ÒÔ´¿xml·½Ê½Í¨ÐÅ¡£
SOAP£º¼òµ¥¶ÔÏó´æÈ¡ÐÒé¡£¿É¿´×öxml·½ÑÔ£» ÒÔSOAPÐÅ·âÀ´´«µÝºÍÏìÓ¦Îı¾£¨°üº¬£ºÊײ¿¡¢Ö÷Ì壩HTTP P ......
FormsÉí·ÝÑéÖ¤ÓÃÀ´ÅжÏÊÇ·ñºÏ·¨Óû§£¬µ±Óû§ºÏ·¨ºó£¬ÔÙͨ¹ýÓû§µÄ½ÇÉ«¾ö¶¨ÄÜ·ÃÎʵÄÒ³Ãæ¡£
Ö÷Ҫ˼Ï룺FormsÉí·ÝÑéÖ¤ÓÃÀ´ÅжÏÊÇ·ñºÏ·¨Óû§£¬µ±Óû§ºÏ·¨ºó£¬ÔÙͨ¹ýÓû§µÄ½ÇÉ«¾ö¶¨ÄÜ·ÃÎʵÄÒ³Ãæ¡£
¾ßÌå²½Ö裺
1¡¢´´½¨Ò»¸öÍøÕ¾£¬½á¹¹ÈçÏ£º
ÍøÕ¾¸ùĿ¼
AdminĿ¼ ----> ¹ÜÀíԱĿ¼
Manager.aspx ----> ¹ÜÀíÔ±¿É ......
asp.net¿ª·¢µÄÅóÓÑ£¬¾³£Óõõ½web.configÎļþµÄÅäÖã¬ËùÒÔÎÒÃÇÌØÕûÀíÁËÖÐÎÄ˵Ã÷¡£
<?xml version="1.0" standalone="yes"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<!--ÅäÖÃÈ«¾Ö±äÁ¿-->
<appSettings>
<add key="examstr" value="server=.;da ......
public string GetPage(int page, int pages, string url)
{
if (pages == 0)
{
&n ......