ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤
ʹÓÃASP.Net FormsģʽʵÏÖWebServiceÉí·ÝÑéÖ¤
ÔÚ°²È«ÐÔÒªÇó²»ÊǺܸߵÄASP.Net³ÌÐòÖУ¬»ùÓÚFormsµÄÉí·ÝÑéÖ¤ÊǾ³£Ê¹ÓõÄÒ»ÖÖ·½Ê½£¬¶øÈç¹ûÐèÒª¶ÔWebService½øÐÐÉí·ÝÑéÖ¤£¬×î³£ÓõĿÉÄÜÊÇ»ùÓÚSoap ±êÍ·µÄ×Ô¶¨ÒåÉí·ÝÑéÖ¤·½Ê½¡£Èç¹û¶ÔÁ½Õß×öһϱȽϵĻ°£¬ÏÔÈ»£¬»ùÓÚFormsµÄÑéÖ¤·½Ê½¸ü¼Ó·½±ãÒ×Óã¬ÄÜ·ñ½«FormsÑéÖ¤·½Ê½Ó¦Óõ½WebServiceÖÐÈ¥ÄØ£¿
´ÓÀíÂÛÉϽ²£¬Ê¹ÓûùÓÚFormsµÄ·½Ê½¶ÔWebService½øÐÐÉí·ÝÑéÖ¤ÊÇ¿ÉÐеģ¬µ«ÊÇʹÓùý³ÌÖлá´æÔÚÒÔÏÂÁ½¸öÎÊÌ⣺
1.»ùÓÚFormsµÄÑéÖ¤·½Ê½Í¬Ê±Ò²ÊÇ»ùÓÚCookieµÄÑéÖ¤·½Ê½£¬ÔÚʹÓÃä¯ÀÀÆ÷ʱ£¬Õâ¸öÎÊÌâÊDz»ÐèÒªÎÒÃÇ¿¼Âǵġ£µ«¶ÔÓÚʹÓÃWebServiceµÄÓ¦ÓóÌÐòÀ´Ëµ£¬Ä¬ÈÏÊDz»Äܱ£´æCookieµÄ£¬ÐèÒªÎÒÃÇ×Ô¼ºÈ¥×öÕâ¸ö¹¤×÷¡£
2.WebService¼ÈÈ»ÊÇÒ»¸öA2A(Application To Application)Ó¦ÓóÌÐò£¬Ê¹ÓÃWeb±íµ¥½øÐÐÉí·ÝÑéÖ¤ÏÔÈ»²»Ì«ºÏÊÊ£¬¶øÇÒ£¬Õ⽫²»¿É±ÜÃâµÄÔì³ÉÈË»ú½»»¥£¬Ê¹WebServiceµÄÓ¦Óôó´òÕÛ¿Û¡£
½ÓÏÂÀ´£¬ÎÒÃǾͷֲ½½â¾öÕâÁ½¸öÎÊÌ⣺
1.CookieµÄ±£´æÎÊÌâ
WebServiceµÄ¿Í»§¶Ë´úÀíÀàÓÐÒ»¸öÊôÐÔCookieContainer¿ÉÓÃÓÚÉèÖûò»ñÈ¡Cookie¼¯ºÏ£¬±£´æCookieµÄÈÎÎñ¾Í½»¸øËûÁË£º
System.Net.CookieContainer cookieContainer = new System.Net.CookieContainer();
MyService.WebService service = new App.MyService.WebService();
service.CookieContainer = cookieContainer;
2.ÎÒÃDz»ÏëʹÓÃWeb±íµ¥½øÐÐÉí·ÝÑéÖ¤£¬ÐÒÔ˵ÄÊÇ£¬ASP.Net±íµ¥ÑéÖ¤ÖÐµÄ±íµ¥Ò³£¨¼´Web.configÎļþÖÐ forms ÔªËØÄÚµÄloginUrl£©Í¬Ñù¿ÉÒÔÖ¸¶¨ÎªWebServiceÎļþ¡£
ÎÒÃÇ´´½¨Ò»¸öרÃÅÓÃ×÷Éí·ÝÑéÖ¤µÄWeb·þÎñ£¬ÔÝÇÒÃüÃûΪLogin.asmx£¬È»ºóÈà loginUrl µÈÓÚ “Login.asmx”£¬µ±È»£¬»¹ÐèÒªÔÚWeb.configÎļþÖÐµÄ authorization ½ÚÖнûÖ¹ÄäÃû·ÃÎÊ£¨·ñÔòÎÒÃǿɾͰ×æ»îÁË£©£¬Íê³ÉÅäÖúóµÄWeb.configÎļþÈçÏ£º
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="false" />
<authentication mode="Forms">
<forms na
Ïà¹ØÎĵµ£º
ASP.NETÊÇÒ»¸ö·Ç³£Ç¿´óµÄ¹¹½¨WebÓ¦ÓõÄƽ̨£¬ËüÌṩÁ˼«´óµÄÁé»îÐÔºÍÄÜÁ¦ÒÔÖÂÓÚ¿ÉÒÔÓÃËüÀ´¹¹½¨ËùÓÐÀàÐ͵ÄWebÓ¦Óá£
¾ø´ó¶àÊýµÄÈËÖ»ÊìϤ¸ß²ãµÄ¿ò¼ÜÈ磺 WebForms ºÍ WebServices --ÕâЩ¶¼ÔÚASP.NET²ã´Î½á¹¹ÔÚ×î¸ß²ã¡£
ÕâƪÎÄÕµÄ×ÊÁÏÊÕ¼¯ÕûÀí×Ô¸÷ÖÖ΢Èí¹«¿ªµÄÎĵµ£¬Í¨¹ý±È½Ï IIS5¡¢IIS6¡¢IIS7 ÕâÈý´ú IIS ¶ÔÇëÇóµÄ´¦Àí¹ý³ ......
ÔÚ¿ª·¢Öб£³ÖÁ¼ºÃµÄ±àÂë¹æ·¶ÊÇÊ®·ÖÖØÒªµÄ¡£ÎÒËù²ÉÓõÄеÄVB.net/ASP.NET±àÂë¹æ·¶£¬ÊÇÒ»ÖÖ±»Ö¤Ã÷ÄÜÃ÷ÏÔ¸ÄÉÆ´úÂë¿É¶ÁÐÔ£¬²¢ÓÐÖúÓÚ´úÂë¹ÜÀí¡¢·ÖÀàµÄ±àÂë¹æ·¶¡£²ÉÓÃÕâÖÖ±àÂë¹æ·¶£¬ÄܱÜÃâÈçÐÙÑÀÀûÃüÃû·¨´øÀ´µÄ·±³¤Ç°×º£¬±ãÓÚ¼ÇÒä±äÁ¿µÄÓÃ;¡£ÏÂÃæµÄ½éÉÜÕâÖÖ±àÂë¹æ·¶¡£
Ò»¡¢ÀàÐͼ¶µ¥Î»µÄÃüÃû
1¡¢Àà
¡õÒÔClassÉùÃ÷µÄÀ࣬¶¼±ØÐë ......
ÒÔÏÂÄÚÈÝ,´ÔÍøÉÏCOPY¹ýÀ´µÄ...
ApacheÊÇÄ¿Ç°¹ã·ºÊ¹ÓõÄÒ»ÖÖÍøÂç·þÎñÆ÷³ÌÐò£¬²»½öÔÚUNIX/LINUXƽ̨Éϱ»´óÁ¿Ê¹Ó㬶øÇÒÔÚWindowsƽ̨ÉÏÒ²ÓÐÐí¶àÕ¾µã·ÅÆúÁËIIS¶øתÏòApache¡£.NETÊÇ΢ÈíÍƳöµÄ¹¦ÄÜÇ¿´óµÄ¿ª·¢¼¼Êõ£¬ÆäÄ¿±ê¾ÍÊÇÓëJava¿¹ºâ¡£ASP.NET·Ç³£ÊʺÏÓÚÖÐСÆóÒµµÄWebÓ¦Óã¬ÆäÐÔÄܽÏASP3.0ÓÐÁ˼«´óµÄÌá¸ß¡£ÏÂÃæ¾Í½éÉÜÈÃAp ......
²»¹ÜʹÓÃʲôÀ´¿ª·¢³ÌÐò£¬¶¼ÉÙ²»ÁËÐèÒª×ö·ÖÒ³£¬Ä¿Ç°Ê¹ÓÃasp.net
mvc¿ª·¢µÄwebÓ¦ÓóÌÐòµÄÈËÔ½À´Ô½¶àÁË£¬ÏàÓ¦µÄ¸¨Öú£¬Ìá¸ß¿ª·¢Ð§ÂʵÄhelper·½·¨¡¢¿Ø¼þ¶¼½«»á³öÏÖ¡£½ñÌìÎÒÏò´ó¼Ò½éÉÜÒ»¿îÔÚasp.net
mvc¿ò¼ÜÖÐʹÓõķÖÒ³¿Ø¼þ¡£±¾ÈËÒ²ÊÇÔÚÐÂÄêµÄʱºò³õ´ÎʹÓ㬵«ÊÇһֱûÓÐÍƼö¸ø´ó¼Ò¡£ÀûÓÃÎåÒ»ÐÝϢʱ¼äÒ²¾Í½éÉܸø´ó¼Ò¡£Éùà ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
¡¡¡¡2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......