asp.net·¢²¼ÍøվʱÈý¸öÑ¡ÏîµÄÎÊÌâ
asp.net·¢²¼ÍøվʱÈý¸öÑ¡ÏîµÄÎÊÌâ
·¢²¼ÍøÕ¾µÄʱºòÓÐÈý¸öÑ¡Ï
µÚÒ»¸öÑ¡ÏîÖ¸¶¨·¢²¼ºóÊDz»ÊÇ¿ÉÒÔÐÞ¸ÄaspxÎļþ£¬Èç¹û¹´Ñ¡£¬Ôò·¢²¼ºóµÄÍøÕ¾ÐÐΪ»ù±¾ÓëASP.NET 1.1Ò»Ö£¬Ö»ÒªÃ»ÓÐÔöɾÐ޸Ŀؼþ£¬¿ÉÒÔÖ±½ÓÔÚ·þÎñÆ÷ÉÏÐÞ¸ÄaspxÎļþ²»ÓÃÖØз¢²¼ÍøÕ¾¡£
µÚ¶þ¸öÑ¡ÏîÖ¸¶¨ÊDz»Êǽ«Ã¿¸öaspxÎļþ¶¼±àÒë³ÉÒ»¸öDLLÎļþ£¬ÕâÑù£¬¾Í¿ÉÒÔÔÚÐÞ¸ÄÁËÄĸöaspxÍøÒ³£¨°üÀ¨aspxºÍcsÎļþ£©£¬Ö»ÐèÒª¸üÐÂÒ»¸öDLLÎļþ¾ÍÐÐÁË£¬²»ÓÃÕûվȫ²¿¸üС£
1 ÔÊÐí¸üдËÔ¤±à¼Õ¾µã
Ñ¡ÖÐÕâÒ»Ïîºó£¬±àÒë³öÀ´µÄ°üÀ¨aspxÎļþºÍdll£¬Óë2003ÏÂÒ»Ñù¡£
²»Ñ¡ÖÐÕâÒ»Ï±àÒë³öÀ´µÄaspxÖÐûÓнçÃæÐÅÏ¢£¬Ö»ÓÐÒ»¾ä¾²Ì¬Îı¾£¬¾ÍÊDz»ÔÊÐí·¢²¼ºóÐÞ¸ÄÒ³Ãæ
ΪÁ˲»Èö©ÔÄÍøÕ¾µÄÓû§ÔÚµÚÒ»´Î´ò¿ªÒ³Ãæʱ¸ÐÊܵ½Ã÷ÏÔµÄÑÓ³Ù,¿ÉÒÔʹÓÃ"ÍêÈ«Ô¤±àÒë(full pre-compilation)"·½Ê½.
Èç¹ûÊÇÏë´Ë±àÒ뷽ʽ¾ßÓÐ×î´óµÄ°²È«ÐÔ,Ӧȥµô"ÔÊÐí¸üдËÔ¤±àÒëÕ¾µã(Allow this precompiled site to be
updateable". ÕâÑù´úÂëÎļþ(code,¼´csÎļþ)ºÍÄÚÈÝÎļþ(content file,¼´aspx)¶¼»áÔ¤±àÒë
2 ʹÓù̶¨ÃüÃûºÍµ¥Ò³³ÌÐò¼¯
»á°¸ÕÕ»ÃæµÄÀàÃû±àÒë³öºÜ¶àÃû×̶ֹ¨µÄdll¡£
3 ¶ÔÔ¤±à¼³ÌÐò¼¯ÆôÓÃÇ¿ÃüÃû
ÔÚ¶àÊýÇé¿öÏÂ,ÍêÈ«Ô¤±àÒ뷽ʽÕýÊÇËùÐèÒªµÄ·½Ê½,µ«ÊÇÓÐʱºòÒòΪÄÚÈÝÎļþ±ä»¯²»´ó,Äã¿ÉÄÜÏ£ÍûÔÚÍøÕ¾·¢²¼ºó,²»ÓÃÿ´Î°ÑËùÓеĴúÂëÓëÄÚÈÝÎļþÈ«²¿±àÒë,Ò²ÐíÄÚÈÝÎļþ¾Í²»ÓÃÔٴαàÒë,Ö»Ðè±àÒë´úÂëÎļþ¼´¿É,ÕâÖÖÇé¿öÏÂ,¾ÍÑ¡ÖÐ"ÔÊÐí¸üдËÔ¤±àÒëÕ¾µã",ÕâÖÖ·½Ê½³ÆΪ"Ö»Ô¤±àÒë´úÂëÎļþ(pre- compilation of code only)"·½Ê½.´Ë·½Ê½Óë"ÍêÈ«Ô¤±àÒ뷽ʽ"Ïà±È½Ï,Ö»ÓÐÒ»µãÇø±ð,¼´ÄÚÈÝÎļþÈÔÊÇÔʼ°æ±¾,¶ø²»ÊÇ´æ¸ù (stub)°æ±¾,ÆäËüЧ¹ûÏàͬ.ÔÚÄÚÈÝÎļþ·¢²¼ºóÒ²¿ÉÒÔ¶ÔÆä½øÐбà¼,Æä±ä¶¯ÔÚÒÔºóµÄÇëÇóµ½À´Ê±Æð×÷ÓÃ,¶ÔÓÚ·ÃÎÊ´ËÕ¾µÄÓû§À´ËµÊÇ͸Ã÷µÄ.
¸½:
Ç¿ÃüÃû(strong names) Èç¹ûÒ»¸öassemblyÐèÒª¹²Ïí,ÔòÆä±ØÐëʹÓÃÇ¿ÃüÃû.Ò»¸öÇ¿ÃüÃûΨһ±êʶÁËÒ»¸öassembly.ÓÐËIJ¿·Ö×é³É: 1,assemblyÃû³Æ(²»°üº¬ÎļþÀ©Õ¹Ãû);2,°æ±¾; 3,culture; 4 ÃÜÔ¿¶Ô(¼´Ò»¸ö¹«Ô¿ºÍÒ»¸ö˽Կ),±£´æÔÚkeyÎļþÖÐ,ËùÒÔ˵ keyÎļþ¾ÍÊÇͬʱ°üº¬Á˹«Ô¿ºÍ˽ԿµÄÎļþ,ÔÚʹÓÃÇ¿ÃüÃûʱµ±È»ÊÇÐèÒª´ËkeyÎļþµÄ.´´½¨keyÎļþÓÃÃüÁî: sn -k KeyPair.snk
ÑÓ³ÙÇ©Ãû:ÏÔÈ»,ÿ¸ö¹«Ë¾µÄ˽Կ¶¼±ØÐë·Ç³£°²È«µØ±£´æ,È»ºóÕâ¾Í´øÀ´Ò»¸ö½øÍËÁ½ÄѵÄÎÊÌâ:ÔÚ¿ª·¢ºÍ²âÊÔÒ»¸ö¹²ÏíµÄassemblyʱ,ÐèҪʹÓÃÇ¿ÃüÃû·½Ê½, ¶ø´´½¨Ç¿ÃüÃûʱ¿Ï¶¨ÐèÒª·ÃÎÊ˽ԿµÄ,µ«ÊÇÓÖ²»Äܰѹ«Ë¾µÄ˽ԿÌá
Ïà¹ØÎĵµ£º
test.xml
<?xml version="1.0" encoding="utf-8" ?>
<root>
<R SecuCode="601600" Glossary="ѧITÍø²âÊÔ»ñÈ¡XML½á¹ûÏÔʾÕý³££¬¡£¡£¡£¡£¡£¡£¡£¹þ¹þ" />
<R SecuCode="600056" Glossary="²âÊÔµÚ¶þ¸ö£¬¡£¡£¡£¡£¡£¡£¡£¹þ¹þ" />
</root>
ÏÂÃæxml½âÎö ......
ÔÚ×¢²á±í System->CurrentControlSet->Services->Eventlog ´¦Ñ¡ÔñÌí¼ÓϵͳÖÐ AspNet Õâ¸öÕË»§×¢ÒâÊÇÔÚÓÒ¼üµÄ °²È«->ȨÏÞ->Ìí¼Ó
дÈÕÖ¾
public static void Log(string sourceName, string message)
{
EventLog eventLog = null;
......
//postÇëÇó
string name = Request["name"].toString();
string name =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ
¶¼¿ÉÓÃstring name = Request["name"].toString();
±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µ ......
1>>δÄܼÓÔØÎļþ»ò³ÌÐò¼¯“System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35”»òËüµÄijһ¸öÒÀÀµÏϵͳÕÒ²»µ½Ö¸¶¨µÄÎļþ¡£
½â¾ö£ºµ½C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies ÏÂÕÒµ½ System.Web.Mvc.dll Îļþ ¸´ÖƵ½ÏîÄ¿µÄbinÄ¿Â¼Ï ......
µÚÒ»£¬ н¨ÍøÕ¾£¬Ñ¡ÔñÀàÐÍΪasp.net web ·þÎñ¡£
ϵͳ×Ô¶¯ÎªÄ㽨Á¢Á˸öÎļþservice.asmx.Õâ¾ÍÊÇÒ»¸ö×î¼òµ¥µÄweb service·þÎñ¡£Äã¿ÉÒÔÖ±½ÓÔËÐв鿴Ч¹û¡£
µÚ¶þ£¬ÎÒÃÇÐèÒªµÄÊÇÐÞ¸Äservice.csÖеĴúÂ룬À´Âú×ãÎÒÃǵÄÒªÇó¡£
Ð޸ĺóµÄService.csÖеĴúÂëΪ£º
using System;
using System.Web;
using System.Web.Services;
......