| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> asp >> ASP.NET chang yong de 26 ge you hua xing neng fang fa

ASP.NET chang yong de 26 ge you hua xing neng fang fa

2008-07-26 07:41:52 编辑來源:互联网 评论
 
 
 
本文为【ASP.NET常用的26个优化性能方法】的拼音翻译版
  1. shu ju ku fang wen xing neng you hua
  shu ju ku de lian jie he guan bi
  fang wen shu ju ku zi yuan xu yao chuang jian lian jie 、 da kai lian jie he guan bi lian jie ji ge cao zuo 。 zhe xie guo cheng xu yao duo ci yu shu ju ku jiao huan xin xi yi tong guo shen fen yan zheng , bi jiao hao fei fu wu qi zi yuan 。ASP.NET zhong ti gong le lian jie chi (Connection Pool) gai shan da kai he guan bi shu ju ku dui xing neng de ying xiang 。 xi tong jiang yong hu de shu ju ku lian jie fang zai lian jie chi zhong , xu yao shi qu chu , guan bi shi shou hui lian jie , deng dai xia yi ci de lian jie qing qiu 。 lian jie chi de da xiao shi you xian de , ru guo zai lian jie chi da dao zui da xian du hou reng yao qiu chuang jian lian jie , bi ran da da ying xiang xing neng 。 yin ci , zai jian li shu ju ku lian jie hou zhi you zai zhen zheng xu yao cao zuo shi cai da kai lian jie , shi yong wan bi hou ma shang guan bi , cong er jin liang jian shao shu ju ku lian jie da kai de shi jian , bi mian chu xian chao chu lian jie xian zhi de qing kuang 。
  shi yong cun chu guo cheng
  cun chu guo cheng shi cun chu zai fu wu qi shang de yi zu yu bian yi de SQL yu ju , lei si yu DOS xi tong zhong de pi chu li wen jian 。 cun chu guo cheng ju you dui shu ju ku li ji fang wen de gong neng , xin xi chu li ji wei xun su 。 shi yong cun chu guo cheng ke yi bi mian dui ming ling de duo ci bian yi , zai zhi xing yi ci hou qi zhi xing gui hua jiu zhu liu zai gao su huan cun zhong , yi hou xu yao shi zhi xu zhi jie tiao yong huan cun zhong de er jin zhi dai ma ji ke 。 ling wai , cun chu guo cheng zai fu wu qi duan yun xing , du li yu ASP.NET cheng xu , bian yu xiu gai , zui chong yao de shi ta ke yi jian shao shu ju ku cao zuo yu ju zai wang luo zhong de chuan shu 。
  you hua cha xun yu ju
  ASP.NET zhong ADO lian jie xiao hao de zi yuan xiang dang da ,SQL yu ju yun xing de shi jian yue chang , zhan yong xi tong zi yuan de shi jian ye yue chang 。 yin ci , jin liang shi yong you hua guo de SQL yu ju yi jian shao zhi xing shi jian 。 bi ru , bu zai cha xun yu ju zhong bao han zi cha xun yu ju , chong fen li yong suo yin deng 。
  2. zi fu chuan cao zuo xing neng you hua
  shi yong zhi lei xing de ToString fang fa
  zai lian jie zi fu chuan shi , jing chang shi yong "+" hao zhi jie jiang shu zi tian jia dao zi fu chuan zhong 。 zhe zhong fang fa sui ran jian dan , ye ke yi de dao zheng que jie guo , dan shi you yu she ji dao bu tong de shu ju lei xing , shu zi xu yao tong guo zhuang xiang cao zuo zhuan hua wei yin yong lei xing cai ke yi tian jia dao zi fu chuan zhong 。 dan shi zhuang xiang cao zuo dui xing neng ying xiang jiao da , yin wei zai jin xing zhe lei chu li shi , jiang zai tuo guan dui zhong fen pei yi ge xin de dui xiang , yuan you de zhi fu zhi dao xin chuang jian de dui xiang zhong 。 shi yong zhi lei xing de ToString fang fa ke yi bi mian zhuang xiang cao zuo , cong er ti gao ying yong cheng xu xing neng 。
  yun yong StringBuilder lei
  String lei dui xiang shi bu ke gai bian de , dui yu String dui xiang de chong xin fu zhi zai ben zhi shang shi chong xin chuang jian le yi ge String dui xiang bing jiang xin zhi fu yu gai dui xiang , qi fang fa ToString dui xing neng de ti gao bing fei hen xian zhu 。 zai chu li zi fu chuan shi , zui hao shi yong StringBuilder lei , qi .NET ming ming kong jian shi System.Text。 gai lei bing fei chuang jian xin de dui xiang , er shi tong guo Append,Remove,Insert deng fang fa zhi jie dui zi fu chuan jin xing cao zuo , tong guo ToString fang fa fan hui cao zuo jie guo 。 qi ding yi ji cao zuo yu ju ru xia suo shi :
  int num;
  System.Text.StringBuilder str = new System.Text.StringBuilder(); // chuang jian zi fu chuan
  str.Append(num.ToString()); // tian jia shu zhi num
  Response.Write(str.ToString); // xian shi cao zuo jie guo
  3. you hua Web fu wu qi ji suan ji he te ding ying yong cheng xu de pei zhi wen jian yi fu he nin de te ding xu yao
  mo ren qing kuang xia ,ASP.NET pei zhi bei she zhi cheng qi yong zui guang fan de gong neng bing jin liang shi ying zui chang jian de fang an 。 yin ci , ying yong cheng xu kai fa ren yuan ke yi gen ju ying yong cheng xu suo shi yong de gong neng , you hua he geng gai qi zhong de mou xie pei zhi , yi ti gao ying yong cheng xu de xing neng 。 xia mian de lie biao shi nin ying gai kao lv de yi xie xuan xiang 。
  jin dui xu yao de ying yong cheng xu qi yong shen fen yan zheng 。
  mo ren qing kuang xia , shen fen yan zheng mo shi wei Windows, huo ji cheng NTLM。 da duo shu qing kuang xia , dui yu xu yao shen fen yan zheng de ying yong cheng xu , zui hao zai Machine.config wen jian zhong jin yong shen fen yan zheng , bing zai Web.config wen jian zhong qi yong shen fen yan zheng 。 gen ju shi dang de qing qiu he xiang ying bian ma she zhi lai pei zhi ying yong cheng xu 。ASP.NET mo ren bian ma ge shi wei UTF-8。 ru guo nin de ying yong cheng xu wei yan ge de ASCII, qing pei zhi ying yong cheng xu shi yong ASCII yi huo de shao xu de xing neng ti gao 。
  kao lv dui ying yong cheng xu jin yong AutoEventWireup。
  zai Machine.config wen jian zhong jiang AutoEventWireup shu xing she zhi wei false, yi wei zhe ye mian bu jiang fang fa ming yu shi jian jin xing pi pei he jiang liang zhe gua gou ( li ru Page_Load)。 ru guo ye mian kai fa ren yuan yao shi yong zhe xie shi jian , xu yao zai ji lei zhong chong xie zhe xie fang fa ( li ru , xu yao wei ye mian jia zai shi jian chong xie Page.OnLoad, er bu shi shi yong Page_Load fang fa )。 ru guo jin yong AutoEventWireup, ye mian jiang tong guo jiang shi jian lian jie liu gei ye mian zuo zhe er bu shi zi dong zhi xing ta , huo de shao xu de xing neng ti sheng 。
  cong qing qiu chu li guan xian zhong yi chu bu yong de mo kuai 。
  mo ren qing kuang xia , fu wu qi ji suan ji de Machine.config wen jian zhong jie dian de suo you gong neng yun bao liu wei ji huo 。 gen ju ying yong cheng xu suo shi yong de gong neng , nin ke yi cong qing qiu guan xian zhong yi chu bu yong de mo kuai yi huo de shao xu de xing neng ti sheng 。 jian cha mei ge mo kuai ji qi gong neng , bing an nin de xu yao zi ding yi ta 。 li ru , ru guo nin zai ying yong cheng xu zhong bu shi yong hui hua zhuang tai he shu chu huan cun , ze ke yi cong lie biao zhong yi chu ta men , yi bian qing qiu zai bu zhi xing qi ta you yi yi de chu li shi , bu bi zhi xing mei ge mo kuai de jin ru he li kai dai ma 。
  4. yi ding yao jin yong tiao shi mo shi
  zai bu shu sheng chan ying yong cheng xu huo jin xing ren he xing neng ce liang zhi qian , shi zhong ji zhu jin yong tiao shi mo shi 。 ru guo qi yong le tiao shi mo shi , ying yong cheng xu de xing neng ke neng shou dao fei chang da de ying xiang 。
  5. dui yu guang fan yi lai wai bu zi yuan de ying yong cheng xu , qing kao lv zai duo chu li qi ji suan ji shang qi yong wang luo yuan yi
  ASP.NET jin cheng mo xing bang zhu qi yong duo chu li qi ji suan ji shang de ke suo fang xing , jiang gong zuo fen fa gei duo ge jin cheng ( mei ge CPU yi ge ), bing qie mei ge jin cheng dou jiang chu li qi guan xi she zhi wei qi CPU。 ci ji shu cheng wei wang luo yuan yi 。 ru guo ying yong cheng xu shi yong jiao man de shu ju ku fu wu qi huo tiao yong ju you wai bu yi lai xiang de COM dui xiang ( zhe li zhi shi ti ji liang zhong ke neng xing ), ze wei nin de ying yong cheng xu qi yong wang luo yuan yi shi you yi de 。 dan shi , zai jue ding qi yong wang luo yuan yi zhi qian , nin ying gai ce shi ying yong cheng xu zai wang luo yuan zhong de zhi xing qing kuang 。
  6. zhi yao ke neng , jiu huan cun shu ju he ye shu chu
  ASP.NET ti gong le yi xie jian dan de ji zhi , ta men hui zai bu xu yao wei mei ge ye qing qiu dong tai ji suan ye shu chu huo shu ju shi huan cun zhe xie ye shu chu huo shu ju 。 ling wai , tong guo she ji yao jin xing huan cun de ye he shu ju qing qiu ( te bie shi zai zhan dian zhong yu qi jiang you jiao da tong xun liang de qu yu ), ke yi you hua zhe xie ye de xing neng 。 yu .NET Framework de ren he Web chuang ti gong neng xiang bi , shi dang di shi yong huan cun ke yi geng hao de ti gao zhan dian de xing neng , you shi zhe zhong ti gao shi chao shu liang ji de 。 shi yong ASP.NET huan cun ji zhi you liang dian xu yao zhu yi 。 shou xian , bu yao huan cun tai duo xiang 。 huan cun mei ge xiang yun you kai xiao , te bie shi zai nei cun shi yong fang mian 。 bu yao huan cun rong yi chong xin ji suan he hen shao shi yong de xiang 。 qi ci , gei huan cun de xiang fen pei de you xiao qi bu yao tai duan 。 hen kuai dao qi de xiang hui dao zhi huan cun zhong bu bi yao de zhou zhuan , bing qie jing chang dao zhi geng duo de dai ma qing chu he la ji hui shou gong zuo 。 ruo guan xin ci wen ti , qing jian shi yu ASP.NET Applications xing neng dui xiang guan lian de Cache Total Turnover Rate xing neng ji shu qi 。 gao zhou zhuan lv ke neng shuo ming cun zai wen ti , te bie shi dang xiang zai dao qi qian bei yi chu shi 。 zhe ye cheng zuo nei cun ya li 。
  7. xuan ze shi he ye mian huo ying yong cheng xu de shu ju cha kan ji zhi
  gen ju nin xuan ze zai Web chuang ti ye xian shi shu ju de fang shi , zai bian li he xing neng zhi jian chang chang cun zai zhe chong yao de quan heng 。 li ru ,DataGrid Web fu wu qi kong jian ke neng shi yi zhong xian shi shu ju de fang bian kuai jie de fang fa , dan jiu xing neng er yan ta de kai xiao chang chang shi zui da de 。 zai mou xie jian dan de qing kuang xia , nin tong guo sheng cheng shi dang de HTML zi ji cheng xian shu ju ke neng hen you xiao , dan shi zi ding yi he liu lan qi ding xiang hui hen kuai di xiao suo huo de de e wai gong xiao 。Repeater Web fu wu qi kong jian shi bian li he xing neng de zhe zhong 。 ta gao xiao 、 ke zi ding yi qie ke bian cheng 。
  8. jiang SqlDataReader lei yong yu kuai su zhi jin shu ju you biao
  SqlDataReader lei ti gong le yi zhong du qu cong SQL Server shu ju ku jian suo de zhi jin shu ju liu de fang fa 。 ru guo dang chuang jian ASP.NET ying yong cheng xu shi chu xian yuan xu nin shi yong ta de qing kuang , ze SqlDataReader lei ti gong bi DataSet lei geng gao de xing neng 。 qing kuang zhi suo yi zhe yang , shi yin wei SqlDataReader shi yong SQL Server de ben ji wang luo shu ju chuan shu ge shi cong shu ju ku lian jie zhi jie du qu shu ju 。 ling wai ,SqlDataReader lei shi xian IEnumerable jie kou , gai jie kou ye yuan xu nin jiang shu ju bang ding dao fu wu qi kong jian 。 you guan geng duo xin xi , qing shen jian SqlDataReader lei 。 you guan ASP.NET ru he fang wen shu ju de xin xi , qing shen jian tong guo ASP.NET fang wen shu ju 。
  9. jiang SQL Server cun chu guo cheng yong yu shu ju fang wen
  zai .NET Framework ti gong de suo you shu ju fang wen fang fa zhong , ji yu SQL Server de shu ju fang wen shi sheng cheng gao xing neng 、 ke suo fang Web ying yong cheng xu de tui jian xuan ze 。 shi yong tuo guan SQL Server ti gong cheng xu shi , ke tong guo shi yong bian yi de cun chu guo cheng er bu shi te shu cha xun huo de e wai de xing neng ti gao 。
  10. bi mian dan xian cheng dan yuan (STA) COM zu jian
  mo ren qing kuang xia ,ASP.NET bu yuan xu ren he STA COM zu jian zai ye mian nei yun xing 。 ruo yao yun xing ta men , bi xu zai .aspx wen jian nei jiang ASPCompat=true shu xing bao han zai @ Page zhi ling zhong 。 zhe yang jiu jiang zhi xing yong de xian cheng chi qie huan dao STA xian cheng chi , er qie shi HttpContext he qi ta nei zhi dui xiang ke yong yu COM dui xiang 。 qian zhe ye shi yi zhong xing neng you hua , yin wei ta bi mian le jiang duo xian cheng dan yuan (MTA) feng song dao STA xian cheng de ren he tiao yong 。 shi yong STA COM zu jian ke neng da da sun hai xing neng , ying jin liang bi mian 。 ruo bi xu shi yong STA COM zu jian , ru zai ren he interop fang an zhong , ze ying zai zhi xing qi jian jin xing da liang tiao yong bing zai mei ci tiao yong qi jian fa song jin ke neng duo de xin xi 。 ling wai , xiao xin bu yao zai gou zao ye mian qi jian chuang jian ren he STA COM zu jian 。 li ru xia mian de dai ma zhong , zai ye mian gou zao shi jiang shi li hua you mou ge xian cheng chuang jian de MySTAComponent, er gai xian cheng bing bu shi jiang yun xing ye mian de STA xian cheng 。 zhe ke neng dui xing neng you bu li ying xiang , yin wei yao gou zao ye mian jiu bi xu wan cheng MTA he STA xian cheng zhi jian de feng song chu li 。
  <%@ Page Language="VB" ASPCompat="true" %>
  <script. runat=server>
  Dim myComp as new MySTAComponent()
  Public Sub Page_Load()
  myComp.Name = "Bob"
  End Sub
  </script>
  <html>
  <%
  Response.Write(myComp.SayHello)
  %>Response.Write(myComp.SayHello)
  %>
  </html>
  shou xuan ji zhi shi tui chi dui xiang de chuang jian , zhi dao yi hou zai STA xian cheng xia zhi xing shang shu dai ma , ru xia mian de li zi suo shi 。
  <%@ Page Language="VB" ASPCompat="true" %>
  <script. runat=server>
  Dim myComp
  Public Sub Page_Load()
  myComp = new MySTAComponent()
  myComp.Name = "Bob"
  End Sub
  </script>
  <html>
  <%
  Response.Write(myComp.SayHello)
  %>Response.Write(myComp.SayHello)
  %>
  </html>
  tui jian de zuo fa shi zai xu yao shi huo zhe zai Page_Load fang fa zhong gou zao ren he COM zu jian he wai bu zi yuan 。 yong yuan bu yao jiang ren he STA COM zu jian cun chu zai ke yi you gou zao ta de xian cheng yi wai de qi ta xian cheng fang wen de gong xiang zi yuan li 。 zhe lei zi yuan bao kuo xiang huan cun he hui hua zhuang tai zhe yang de zi yuan 。 ji shi STA xian cheng tiao yong STA COM zu jian , ye zhi you gou zao ci STA COM zu jian de xian cheng neng gou shi ji wei gai tiao yong fu wu , er zhe yao qiu feng song chu li dui chuang jian zhe xian cheng de tiao yong 。 ci feng song chu li ke neng chan sheng chong da de xing neng sun shi he ke shen suo xing wen ti 。 zai zhe zhong qing kuang xia , qing yan jiu yi xia shi COM zu jian cheng wei MTA COM zu jian de ke neng xing , huo zhe geng hao de ban fa shi qian yi dai ma yi shi dui xiang cheng wei tuo guan dui xiang 。
  11. jiang tiao yong mi ji xing de COM zu jian qian yi dao tuo guan dai ma
  .NET Framework ti gong le yi ge jian dan de fang fa yu chuan tong de COM zu jian jin xing jiao hu 。 qi you dian shi ke yi zai bao liu xian you tou zi de tong shi li yong xin de ping tai 。 dan shi zai mou xie qing kuang xia , bao liu jiu zu jian de xing neng kai xiao shi de jiang zu jian qian yi dao tuo guan dai ma shi zhi de de 。 mei yi qing kuang dou shi bu yi yang de , jue ding shi fou xu yao qian yi zu jian de zui hao fang fa shi dui Web zhan dian yun xing xing neng ce liang 。 jian yi nin yan jiu yi xia ru he jiang xu yao da liang tiao yong yi jin xing jiao hu de ren he COM zu jian qian yi dao tuo guan dai ma 。 xu duo qing kuang xia bu ke neng jiang jiu shi zu jian qian yi dao tuo guan dai ma , te bie shi zai zui chu qian yi Web ying yong cheng xu shi 。 zai zhe zhong qing kuang xia , zui da de xing neng zhang ai zhi yi shi jiang shu ju cong fei tuo guan huan jing feng song dao tuo guan huan jing 。 yin ci , zai jiao hu cao zuo zhong , qing zai ren he yi duan zhi xing jin ke neng duo de ren wu , ran hou jin xing yi ge da tiao yong er bu shi yi xi lie xiao tiao yong 。 li ru , gong gong yu yan yun xing ku zhong de suo you zi fu chuan dou shi Unicode de , suo yi ying zai tiao yong tuo guan dai ma zhi qian jiang zu jian zhong de suo you zi fu chuan zhuan huan cheng Unicode ge shi 。 ling wai , yi chu li wan ren he COM dui xiang huo ben ji zi yuan jiu shi fang ta men 。 zhe yang , qi ta qing qiu jiu neng gou shi yong ta men , bing qie zui da xian du di jian shao le yin shao hou qing qiu la ji hui shou qi shi fang ta men suo yin qi de xing neng wen ti 。
  12. zai Visual Basic .NET huo JScript. dai ma zhong shi yong zao qi bang ding
  yi wang , kai fa ren yuan xi huan shi yong Visual Basic、VBScript. he JScript. de yuan yin zhi yi jiu shi ta men suo wei “ wu lei xing ” de xing zhi 。 bian liang bu xu yao xian shi lei xing sheng ming , bing neng gou jian dan di tong guo shi yong lai chuang jian ta men 。 dang cong yi ge lei xing dao ling yi ge lei xing jin xing fen pei shi , zhuan huan jiang zi dong zhi xing 。 bu guo , zhe zhong bian li hui da da sun hai ying yong cheng xu de xing neng 。Visual Basic xian zai tong guo shi yong Option Strict bian yi qi zhi ling lai zhi chi lei xing an quan bian cheng 。 wei le xiang hou jian rong , mo ren qing kuang xia ,ASP.NET bu qi yong gai xuan xiang 。 dan shi , wei le de dao zui jia xing neng , qiang lie jian yi zai ye zhong qi yong gai xuan xiang 。 ruo yao qi yong Option Strict, qing jiang Strict shu xing bao kuo zai @ Page zhi ling zhong , huo zhe , dui yu yong hu kong jian , qing jiang gai shu xing bao kuo zai @ Control zhi ling zhong 。 xia mian de shi li yan shi le ru he she zhi gai shu xing , bing jin xing le si ge bian liang tiao yong yi xian shi shi yong gai shu xing shi ru he dao zhi bian yi qi cuo wu de 。
  <%@ Page Language="VB" Strict="true" %>
  <%
  Dim B
  Dim C As String
  ' This will cause a compiler error.
  A = "Hello"
  ' This will cause a compiler error.
  B = "World"
  ' This will not cause a compiler error.
  C = "!!!!!!"
  ' But this will cause a compiler error.
  C = 0
  %>Dim B
  Dim C As String
  ' This will cause a compiler error.
  A = "Hello"
  ' This will cause a compiler error.
  B = "World"
  ' This will not cause a compiler error.
  C = "!!!!!!"
  ' But this will cause a compiler error.
  C = 0
  %> JScript. .NET ye zhi chi wu lei xing bian cheng , dan ta bu ti gong qiang zhi zao qi bang ding de bian yi qi zhi ling 。 ruo fa sheng xia mian ren he yi zhong qing kuang , ze bian liang shi wan qi bang ding de : bei xian shi sheng ming wei Object, shi wu lei xing sheng ming de lei de zi duan , shi wu xian shi lei xing sheng ming de zhuan yong han shu huo fang fa cheng yuan , bing qie wu fa cong qi shi yong tui duan chu lei xing 。 zui hou yi ge cha bie bi jiao fu duo , yin wei ru guo JScript. .NET bian yi qi ke yi gen ju bian liang de shi yong qing kuang tui duan chu lei xing , ta jiu hui jin xing you hua 。 zai xia mian de shi li zhong , bian liang A shi zao qi bang ding de , dan bian liang B shi wan qi bang ding de 。
  var A;
  var B;
  A = "Hello";
  B = "World";
  B = 0; wei le huo de zui jia de xing neng , dang sheng ming JScript. .NET bian liang shi , qing wei qi fen pei yi ge lei xing 。 li ru ,var A : String。
  13. shi qing qiu guan xian nei de suo you mo kuai jin ke neng gao xiao
  qing qiu guan xian nei de suo you mo kuai zai mei ci qing qiu zhong dou you ji hui bei yun xing 。 yin ci , dang qing qiu jin ru he li kai mo kuai shi kuai su di chu fa dai ma zhi guan chong yao , te bie shi zai bu shi yong mo kuai gong neng de dai ma lu jing li 。 fen bie zai shi yong ji bu shi yong mo kuai he pei zhi wen jian shi zhi xing tun tu liang ce shi , dui que ding zhe xie fang fa de zhi xing su du fei chang you yong 。
  14. shi yong HttpServerUtility.Transfer fang fa zai tong yi ying yong cheng xu de ye mian jian chong ding xiang
  cai yong Server.Transfer yu fa , zai ye mian zhong shi yong gai fang fa ke bi mian bu bi yao de ke hu duan chong ding xiang 。
  15. bi yao shi tiao zheng ying yong cheng xu mei ge fu zhu jin cheng de xian cheng shu
  ASP.NET de qing qiu jie gou shi tu zai zhi xing qing qiu de xian cheng shu he ke yong zi yuan zhi jian da dao yi zhong ping heng 。 yi zhi yi ge shi yong zu gou CPU gong lv de ying yong cheng xu , gai jie gou jiang gen ju ke yong yu qing qiu de CPU gong lv , lai jue ding yuan xu tong shi zhi xing de qing qiu shu 。 zhe xiang ji shu cheng zuo xian cheng men kong 。 dan shi zai mou xie tiao jian xia , xian cheng men kong suan fa bu shi hen you xiao 。 tong guo shi yong yu ASP.NET Applications xing neng dui xiang guan lian de Pipeline Instance Count xing neng ji shu qi , ke yi zai PerfMon zhong jian shi xian cheng men kong 。 dang ye mian tiao yong wai bu zi yuan , ru shu ju ku fang wen huo XML Web services qing qiu shi , ye mian qing qiu tong chang ting zhi bing shi fang CPU。 ru guo mou ge qing qiu zheng zai deng dai bei chu li , bing qie xian cheng chi zhong you yi ge xian cheng shi zi you de , na me zhe ge zheng zai deng dai de qing qiu jiang kai shi bei chu li 。 yi han de shi , you shi zhe ke neng dao zhi Web fu wu qi shang cun zai da liang tong shi chu li de qing qiu he xu duo zheng zai deng dai de xian cheng , er ta men dui fu wu qi xing neng you bu li ying xiang 。 tong chang , ru guo men kong yin zi shi wai bu zi yuan de xiang ying shi jian , ze rang guo duo qing qiu deng dai zi yuan , dui Web fu wu qi de tun tu liang bing wu bang zhu 。 wei huan he zhe zhong qing kuang , ke yi tong guo geng gai Machine.config pei zhi wen jian jie dian de maxWorkerThreads he maxIOThreads shu xing , shou dong she zhi jin cheng zhong de xian cheng shu xian zhi 。
  zhu yi : fu zhu xian cheng shi yong lai chu li ASP.NET qing qiu de , er IO xian cheng ze shi yong yu wei lai zi wen jian 、 shu ju ku huo XML Web services de shu ju ti gong fu wu de 。 fen pei gei zhe xie shu xing de zhi shi jin cheng zhong mei ge CPU mei lei xian cheng de zui da shu mu 。 dui yu shuang chu li qi ji suan ji , zui da shu shi she zhi zhi de liang bei 。 dui yu si chu li qi ji suan ji , zui da zhi shi she zhi zhi de si bei 。 wu lun ru he , dui yu you si ge huo ba ge CPU de ji suan ji , zui hao geng gai mo ren zhi 。 dui yu you yi ge huo liang ge chu li qi de ji suan ji , mo ren zhi jiu ke yi , dan dui yu you geng duo chu li qi de ji suan ji de xing neng , jin cheng zhong you yi bai huo liang bai ge xian cheng ze bi da yu li 。 zhu yi jin cheng zhong you tai duo xian cheng wang wang hui jiang di fu wu qi de su du , yin wei e wai de shang xia wen jiao huan dao zhi cao zuo xi tong jiang CPU zhou qi hua zai wei hu xian cheng er bu shi chu li qing qiu shang 。
  16. shi dang di shi yong gong gong yu yan yun xing ku de la ji hui shou qi he zi dong nei cun guan li
  xiao xin bu yao gei mei ge qing qiu fen pei guo duo nei cun , yin wei zhe yang la ji hui shou qi jiang bi xu geng pin fan di jin xing geng duo de gong zuo 。 ling wai , bu yao rang bu bi yao de zhi zhen zhi xiang dui xiang , yin wei ta men jiang shi dui xiang bao chi huo dong zhuang tai , bing qie ying jin liang bi mian han Finalize fang fa de dui xiang , yin wei ta men zai hou mian hui dao zhi geng duo de gong zuo 。 te bie shi zai Finalize tiao yong zhong yong yuan bu yao shi fang zi yuan , yin wei zi yuan zai bei la ji hui shou qi hui shou zhi qian ke neng yi zhi xiao hao zhe nei cun 。 zui hou zhe ge wen ti jing chang hui dui Web fu wu qi huan jing de xing neng zao cheng hui mie xing de da ji , yin wei zai deng dai Finalize yun xing shi , hen rong yi hao jin mou ge te ding de zi yuan 。
  17. ru guo you da xing Web ying yong cheng xu , ke kao lv zhi xing yu pi bian yi
  mei dang fa sheng dui mu lu de di yi ci qing qiu shi dou hui zhi xing pi bian yi 。 ru guo mu lu zhong de ye mian mei you bei fen xi bing bian yi , ci gong neng hui cheng pi fen xi bing bian yi mu lu zhong de suo you ye mian , yi bian geng hao di li yong ci pan he nei cun 。 ru guo zhe xu yao hen chang shi jian , ze jiang kuai su fen xi bing bian yi dan ge ye mian , yi bian qing qiu neng bei chu li 。 ci gong neng dai gei ASP.NET xing neng shang de hao chu , yin wei ta jiang xu duo ye mian bian yi wei dan ge cheng xu ji 。 cong yi jia zai de cheng xu ji fang wen yi ye bi mei ye jia zai xin de cheng xu ji yao kuai 。 pi bian yi de que dian zai yu : ru guo fu wu qi jie shou dao xu duo dui shang wei bian yi de ye mian de qing qiu , na me dang Web fu wu qi fen xi bing bian yi ta men shi , xing neng ke neng jiao cha 。 wei jie jue zhe ge wen ti , ke yi zhi xing yu pi bian yi 。 wei ci , zhi xu zai ying yong cheng xu ji huo zhi qian xiang ta qing qiu yi ge ye mian , wu lun na ye yun ke 。 ran hou , dang yong hu shou ci fang wen nin de zhan dian shi , ye mian ji qi cheng xu ji jiang yi bei bian yi 。 mei you jian dan de ji zhi ke yi zhi dao pi bian yi he shi fa sheng 。 xu yi zhi deng dao CPU kong xian huo zhe mei you geng duo de bian yi qi jin cheng ( li ru csc.exe(C# bian yi qi ) huo vbc.exe(Visual Basic bian yi qi )) qi dong 。 huan ying jin liang bi mian geng gai ying yong cheng xu de bin mu lu zhong de cheng xu ji 。 geng gai ye mian hui dao zhi chong xin fen xi he bian yi gai ye , er ti huan bin mu lu zhong de cheng xu ji ze hui dao zhi wan quan chong xin pi bian yi gai mu lu 。 zai bao han xu duo ye mian de da gui mo zhan dian shang , geng hao de ban fa ke neng shi gen ju ji hua ti huan ye mian huo cheng xu ji de pin fan cheng du lai she ji bu tong de mu lu jie gou 。 bu chang geng gai de ye mian ke yi cun chu zai tong yi mu lu zhong bing zai te ding de shi jian jin xing yu pi bian yi 。 jing chang geng gai de ye mian ying zai ta men zi ji de mu lu zhong ( mei ge mu lu zui duo ji bai ye ) yi bian kuai su bian yi 。Web ying yong cheng xu ke yi bao han xu duo zi mu lu 。 pi bian yi fa sheng zai mu lu ji , er bu shi ying yong cheng xu ji 。
  18. bu yao yi lai dai ma zhong de yi chang
  yin wei yi chang da da di jiang di xing neng , suo yi nin bu ying gai jiang ta men yong zuo kong zhi zheng chang cheng xu liu cheng de fang shi 。 ru guo you ke neng jian ce dao dai ma zhong ke neng dao zhi yi chang de zhuang tai , qing zhi xing zhe zhong cao zuo 。 bu yao zai chu li gai zhuang tai zhi qian bu huo yi chang ben shen 。 chang jian de fang an bao kuo : jian cha null, fen pei gei jiang fen xi wei shu zi zhi de String yi ge zhi , huo zai ying yong shu xue yun suan qian jian cha te ding zhi 。 xia mian de shi li yan shi ke neng dao zhi yi chang de dai ma yi ji ce shi shi fou cun zai mou zhong zhuang tai de dai ma 。 liang zhe chan sheng xiang tong de jie guo 。
  try
  {
  result = 100 / num;
  }
  catch (Exception e)
  {
  result = 0;
  }
  // ...to this.
  if (num != 0)
  result = 100 / num;
  else
  result = 0;
  19. shi yong HttpResponse.Write fang fa jin xing zi fu chuan chuan lian
  gai fang fa ti gong fei chang you xiao de huan chong he lian jie fu wu 。 dan shi , ru guo nin zheng zai zhi xing guang fan de lian jie , qing shi yong duo ge Response.Write tiao yong 。 xia mian shi li zhong xian shi de ji shu bi yong dui Response.Write fang fa de dan ge tiao yong lian jie zi fu chuan geng kuai 。
  Response.Write("a");
  Response.Write(myString);
  Response.Write("b");
  Response.Write(myObj.ToString());
  Response.Write("c");
  Response.Write(myString2);
  Response.Write("d");
  20. chu fei you te shu de yuan yin yao guan bi huan chong , fou ze shi qi bao chi da kai
  jin yong Web chuang ti ye de huan chong hui dao zhi da liang de xing neng kai xiao 。
  21. zhi zai bi yao shi bao cun fu wu qi kong jian shi tu zhuang tai
  zi dong shi tu zhuang tai guan li shi fu wu qi kong jian de gong neng , gai gong neng shi fu wu qi kong jian ke yi zai wang fan guo cheng shang chong xin tian chong ta men de shu xing zhi ( nin bu xu yao bian xie ren he dai ma )。 dan shi , yin wei fu wu qi kong jian de shi tu zhuang tai zai yin cang de chuang ti zi duan zhong wang fan yu fu wu qi , suo yi gai gong neng que shi hui dui xing neng chan sheng ying xiang 。 nin ying gai zhi dao zai na xie qing kuang xia shi tu zhuang tai hui you suo bang zhu , zai na xie qing kuang xia ta ying xiang ye de xing neng 。 li ru , ru guo nin jiang fu wu qi kong jian bang ding dao mei ge wang fan guo cheng shang de shu ju , ze jiang yong cong shu ju bang ding cao zuo huo de de xin zhi ti huan bao cun de shi tu zhuang tai 。 zai zhe zhong qing kuang xia , jin yong shi tu zhuang tai ke yi jie sheng chu li shi jian 。 mo ren qing kuang xia , wei suo you fu wu qi kong jian qi yong shi tu zhuang tai 。 ruo yao jin yong shi tu zhuang tai , qing jiang kong jian de EnableViewState shu xing she zhi wei false, ru xia mian de DataGrid fu wu qi kong jian shi li suo shi 。
  <asp:datagrid EnableViewState="false" datasource="..." runat="server"/>
  nin huan ke yi shi yong @ Page zhi ling jin yong zheng ge ye de shi tu zhuang tai 。 dang nin bu cong ye hui fa dao fu wu qi shi , zhe jiang shi fen you yong :
  <%@ Page EnableViewState="false" %>
  zhu yi :@ Control zhi ling zhong ye zhi chi EnableViewState shu xing , gai zhi ling yuan xu nin kong zhi shi fou wei yong hu kong jian qi yong shi tu zhuang tai 。 ruo yao fen xi ye shang fu wu qi kong jian shi yong de shi tu zhuang tai de shu liang , qing ( tong guo jiang trace="true" shu xing bao kuo zai @ Page zhi ling zhong ) qi yong gai ye de gen zong bing cha kan Control Hierarchy biao de Viewstate lie 。 you guan gen zong he ru he qi yong ta de xin xi , qing shen jian ASP.NET gen zong 。
  22. bi mian dao fu wu qi de bu bi yao de wang fan guo cheng
  sui ran nin hen ke neng xi wang jin liang duo di shi yong Web chuang ti ye kuang jia de na xie jie sheng shi jian he dai ma de gong neng , dan zai mou xie qing kuang xia que bu yi shi yong ASP.NET fu wu qi kong jian he hui fa shi jian chu li 。 tong chang , zhi you zai jian suo huo cun chu shu ju shi , nin cai xu yao qi dong dao fu wu qi de wang fan guo cheng 。 duo shu shu ju cao zuo ke zai zhe xie wang fan guo cheng jian de ke hu duan shang jin xing 。 li ru , cong HTML chuang ti yan zheng yong hu shu ru jing chang ke zai shu ju ti jiao dao fu wu qi zhi qian zai ke hu duan jin xing 。 tong chang , ru guo bu xu yao jiang xin xi chuan di dao fu wu qi yi jiang qi cun chu zai shu ju ku zhong , na me nin bu ying gai bian xie dao zhi wang fan guo cheng de dai ma 。 ru guo nin kai fa zi ding yi fu wu qi kong jian , qing kao lv rang ta men wei zhi chi ECMAScript. de liu lan qi cheng xian ke hu duan dai ma 。 tong guo yi zhe zhong fang shi shi yong fu wu qi kong jian , nin ke yi xian zhu di jian shao xin xi bei bu bi yao de fa song dao Web fu wu qi de ci shu 。
  shi yong Page.IsPostBack bi mian dui wang fan guo cheng zhi xing bu bi yao de chu li
  ru guo nin bian xie chu li fu wu qi kong jian hui fa chu li de dai ma , you shi ke neng xu yao zai shou ci qing qiu ye shi zhi xing qi ta dai ma , er bu shi dang yong hu fa song bao han zai gai ye zhong de HTML chuang ti shi zhi xing de dai ma 。 gen ju gai ye shi fou shi xiang ying fu wu qi kong jian shi jian sheng cheng de 。
  shi yong Page.IsPostBack shu xing you tiao jian di zhi xing dai ma
  li ru , xia mian de dai ma yan shi ru he chuang jian shu ju ku lian jie he ming ling , gai ming ling zai shou ci qing qiu gai ye shi jiang shu ju bang ding dao DataGrid fu wu qi kong jian 。
  void Page_Load(Object sender, EventArgs e)
  {
  // Set up a connection and command here.
  if (!Page.IsPostBack)
  {
  String query = "select * from Authors where FirstName like '%JUSTIN%'";
  myCommand.Fill(ds, "Authors");
  myDataGrid.DataBind();
  }
  }
  you yu mei ci qing qiu shi dou zhi xing Page_Load shi jian , shang shu dai ma jian cha IsPostBack shu xing shi fou she zhi wei false。 ru guo shi , ze zhi xing dai ma 。 ru guo gai shu xing she zhi wei true, ze bu zhi xing dai ma 。 zhu yi ru guo bu yun xing zhe zhong jian cha , hui fa ye de xing wei jiang bu geng gai 。Page_Load shi jian de dai ma zai zhi xing fu wu qi kong jian shi jian zhi qian zhi xing , dan zhi you fu wu qi kong jian shi jian de jie guo cai ke neng zai shu chu ye shang cheng xian 。 ru guo bu yun xing gai jian cha , reng jiang wei Page_Load shi jian he gai ye shang de ren he fu wu qi kong jian shi jian zhi xing chu li 。
  23. dang bu shi yong hui hua zhuang tai shi jin yong ta
  bing bu shi suo you de ying yong cheng xu huo ye dou xu yao zhen dui yu ju ti yong hu de hui hua zhuang tai , nin ying gai dui ren he bu xu yao hui hua zhuang tai de ying yong cheng xu huo ye jin yong hui hua zhuang tai 。 ruo yao jin yong ye de hui hua zhuang tai , qing jiang @ Page zhi ling zhong de EnableSessionState shu xing she zhi wei false。 li ru :
  <%@ Page EnableSessi %>
  zhu yi : ru guo ye xu yao fang wen hui hua bian liang , dan bu da suan chuang jian huo xiu gai ta men , ze jiang @ Page zhi ling zhong de EnableSessionState shu xing she zhi wei ReadOnly。 huan ke yi jin yong XML Web services fang fa de hui hua zhuang tai 。 you guan geng duo xin xi , qing shen jian shi yong ASP.NET he XML Web services ke hu duan chuang jian de XML Web services。 ruo yao jin yong ying yong cheng xu de hui hua zhuang tai , qing zai ying yong cheng xu Web.config wen jian de sessionstate pei zhi jie zhong jiang mode shu xing she zhi wei off。 li ru :
  <sessionstate mode="off" />
  24. zai xi xuan ze hui hua zhuang tai ti gong cheng xu
  ASP.NET wei cun chu ying yong cheng xu de hui hua shu ju ti gong le san zhong bu tong de fang fa : jin cheng nei hui hua zhuang tai 、 zuo wei Windows fu wu de jin cheng wai hui hua zhuang tai he SQL Server shu ju ku zhong de jin cheng wai hui hua zhuang tai 。 mei zhong fang fa dou you zi ji de you dian , dan jin cheng nei hui hua zhuang tai shi qi jin wei zhi su du zui kuai de jie jue fang an 。 ru guo zhi zai hui hua zhuang tai zhong cun chu shao liang yi shi shu ju , ze jian yi nin shi yong jin cheng nei ti gong cheng xu 。 jin cheng wai jie jue fang an zhu yao yong yu kua duo ge chu li qi huo duo ge ji suan ji suo fang ying yong cheng xu , huo zhe yong yu fu wu qi huo jin cheng chong xin qi dong shi bu neng diu shi shu ju de qing kuang 。 you guan geng duo xin xi , qing shen jian ASP.NET zhuang tai guan li 。
  25. bu shi yong bu bi yao de Server Control
  ASP.net zhong , da liang de fu wu qi duan kong jian fang bian le cheng xu kai fa , dan ye ke neng dai lai xing neng de sun shi , yin wei yong hu mei cao zuo yi ci fu wu qi duan kong jian , jiu chan sheng yi ci yu fu wu qi duan de wang fan guo cheng 。 yin ci , fei bi yao , ying dang shao shi yong Server Control。
  26. ASP.NET ying yong cheng xu xing neng ce shi
  zai dui ASP.NET ying yong cheng xu jin xing xing neng ce shi zhi qian , ying que bao ying yong cheng xu mei you cuo wu , er qie gong neng zheng que 。 ju ti de xing neng ce shi ke yi cai yong yi xia gong ju jin xing :Web Application Strees Tool (WAS) shi Microsoft fa bu de yi ge mian fei ce shi gong ju , ke yi cong http://webtool.rte.microsoft.com/ shang xia zai 。 ta ke yi mo ni cheng bai shang qian ge yong hu tong shi dui web ying yong cheng xu jin xing fang wen qing qiu , zai fu wu qi shang xing cheng liu liang fu zai , cong er da dao ce shi de mu de , ke yi sheng cheng ping yun TTFB、 ping yun TTLB deng xing neng hui zong bao gao 。Application Center Test (ACT) shi yi ge ce shi gong ju , fu dai yu Visual Studio.NET de qi ye ban zhong , shi Microsoft zheng shi zhi chi de web ying yong cheng xu ce shi gong ju 。 ta neng gou zhi guan di sheng cheng tu biao jie guo , gong neng bi WAS duo , dan bu ju bei duo ge ke hu ji tong shi ce shi de neng li 。 fu wu qi cao zuo xi tong " guan li gong ju " zhong de " xing neng " ji shu qi , ke yi dui fu wu qi jin xing jian ce yi le jie ying yong cheng xu xing neng 。
  jie lun :
  dui yu wang zhan kai fa ren yuan lai shuo , zai bian xie ASP.NET ying yong cheng xu shi zhu yi xing neng wen ti , yang cheng liang hao de xi guan , ti gao ying yong cheng xu xing neng , zhi shao ke yi tui chi bi xu de ying jian sheng ji , jiang di wang zhan de cheng ben 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
1. shu ju ku fang wen xing neng you hua      shu ju ku de lian jie he guan bi    fang wen shu ju ku zi yuan xu yao chuang jian lian jie 、 da kai lian jie he guan bi lian jie ji ge cao zuo 。 zhe xie guo cheng xu yao duo ci yu shu ju ku jiao huan xin xi yi tong guo shen fen yan zheng , bi jiao hao fei fu wu qi zi yuan 。ASP.NET zhong ti gong le lian jie chi (Connection Pool) gai shan da kai he guan bi shu ju ku dui xing neng de ying xiang 。 xi tong jiang yong hu de shu ju ku lian jie fang zai lian jie chi zhong , xu yao shi qu chu , guan bi shi shou hui lian jie , deng dai xia yi ci de lian jie qing qiu 。 lian jie chi de da xiao shi you xian de , ru guo zai lian jie chi da dao zui da xian du hou reng yao qiu chuang jian lian jie , bi ran da da ying xiang xing neng 。 yin ci , zai jian li shu ju ku lian jie hou zhi you zai zhen zheng xu yao cao zuo shi cai da kai lian jie , shi yong wan bi hou ma shang guan bi , cong er jin liang jian shao shu ju ku lian jie da kai de shi jian , bi mian chu xian chao chu lian jie xian zhi de qing kuang 。       shi yong cun chu guo cheng      cun chu guo cheng shi cun chu zai fu wu qi shang de yi zu yu bian yi de SQL yu ju , lei si yu DOS xi tong zhong de pi chu li wen jian 。 cun chu guo cheng ju you dui shu ju ku li ji fang wen de gong neng , xin xi chu li ji wei xun su 。 shi yong cun chu guo cheng ke yi bi mian dui ming ling de duo ci bian yi , zai zhi xing yi ci hou qi zhi xing gui hua jiu zhu liu zai gao su huan cun zhong , yi hou xu yao shi zhi xu zhi jie tiao yong huan cun zhong de er jin zhi dai ma ji ke 。 ling wai , cun chu guo cheng zai fu wu qi duan yun xing , du li yu ASP.NET cheng xu , bian yu xiu gai , zui chong yao de shi ta ke yi jian shao shu ju ku cao zuo yu ju zai wang luo zhong de chuan shu 。    you hua cha xun yu ju       ASP.NET zhong ADO lian jie xiao hao de zi yuan xiang dang da ,SQL yu ju yun xing de shi jian yue chang , zhan yong xi tong zi yuan de shi jian ye yue chang 。 yin ci , jin liang shi yong you hua guo de SQL yu ju yi jian shao zhi xing shi jian 。 bi ru , bu zai cha xun yu ju zhong bao han zi cha xun yu ju , chong fen li yong suo yin deng 。      2. zi fu chuan cao zuo xing neng you hua      shi yong zhi lei xing de ToString fang fa    zai lian jie zi fu chuan shi , jing chang shi yong "+" hao zhi jie jiang shu zi tian jia dao zi fu chuan zhong 。 zhe zhong fang fa sui ran jian dan , ye ke yi de dao zheng que jie guo , dan shi you yu she ji dao bu tong de shu ju lei xing , shu zi xu yao tong guo zhuang xiang cao zuo zhuan hua wei yin yong lei xing cai ke yi tian jia dao zi fu chuan zhong 。 dan shi zhuang xiang cao zuo dui xing neng ying xiang jiao da , yin wei zai jin xing zhe lei chu li shi , jiang zai tuo guan dui zhong fen pei yi ge xin de dui xiang , yuan you de zhi fu zhi dao xin chuang jian de dui xiang zhong 。 shi yong zhi lei xing de ToString fang fa ke yi bi mian zhuang xiang cao zuo , cong er ti gao ying yong cheng xu xing neng 。       yun yong StringBuilder lei      String lei dui xiang shi bu ke gai bian de , dui yu String dui xiang de chong xin fu zhi zai ben zhi shang shi chong xin chuang jian le yi ge String dui xiang bing jiang xin zhi fu yu gai dui xiang , qi fang fa ToString dui xing neng de ti gao bing fei hen xian zhu 。 zai chu li zi fu chuan shi , zui hao shi yong StringBuilder lei , qi .NET ming ming kong jian shi System.Text。 gai lei bing fei chuang jian xin de dui xiang , er shi tong guo Append,Remove,Insert deng fang fa zhi jie dui zi fu chuan jin xing cao zuo , tong guo ToString fang fa fan hui cao zuo jie guo 。    qi ding yi ji cao zuo yu ju ru xia suo shi :   int num;   System.Text.StringBuilder str = new System.Text.StringBuilder(); // chuang jian zi fu chuan   str.Append(num.ToString()); // tian jia shu zhi num   Response.Write(str.ToString); // xian shi cao zuo jie guo   3. you hua Web fu wu qi ji suan ji he te ding ying yong cheng xu de pei zhi wen jian yi fu he nin de te ding xu yao    mo ren qing kuang xia ,ASP.NET pei zhi bei she zhi cheng qi yong zui guang fan de gong neng bing jin liang shi ying zui chang jian de fang an 。 yin ci , ying yong cheng xu kai fa ren yuan ke yi gen ju ying yong cheng xu suo shi yong de gong neng , you hua he geng gai qi zhong de mou xie pei zhi , yi ti gao ying yong cheng xu de xing neng 。 xia mian de lie biao shi nin ying gai kao lv de yi xie xuan xiang 。    jin dui xu yao de ying yong cheng xu qi yong shen fen yan zheng 。    mo ren qing kuang xia , shen fen yan zheng mo shi wei Windows, huo ji cheng NTLM。 da duo shu qing kuang xia , dui yu xu yao shen fen yan zheng de ying yong cheng xu , zui hao zai Machine.config wen jian zhong jin yong shen fen yan zheng , bing zai Web.config wen jian zhong qi yong shen fen yan zheng 。 gen ju shi dang de qing qiu he xiang ying bian ma she zhi lai pei zhi ying yong cheng xu 。ASP.NET mo ren bian ma ge shi wei UTF-8。 ru guo nin de ying yong cheng xu wei yan ge de ASCII, qing pei zhi ying yong cheng xu shi yong ASCII yi huo de shao xu de xing neng ti gao 。    kao lv dui ying yong cheng xu jin yong AutoEventWireup。    zai Machine.config wen jian zhong jiang AutoEventWireup shu xing she zhi wei false, yi wei zhe ye mian bu jiang fang fa ming yu shi jian jin xing pi pei he jiang liang zhe gua gou ( li ru Page_Load)。 ru guo ye mian kai fa ren yuan yao shi yong zhe xie shi jian , xu yao zai ji lei zhong chong xie zhe xie fang fa ( li ru , xu yao wei ye mian jia zai shi jian chong xie Page.OnLoad, er bu shi shi yong Page_Load fang fa )。 ru guo jin yong AutoEventWireup, ye mian jiang tong guo jiang shi jian lian jie liu gei ye mian zuo zhe er bu shi zi dong zhi xing ta , huo de shao xu de xing neng ti sheng 。    cong qing qiu chu li guan xian zhong yi chu bu yong de mo kuai 。    mo ren qing kuang xia , fu wu qi ji suan ji de Machine.config wen jian zhong jie dian de suo you gong neng yun bao liu wei ji huo 。 gen ju ying yong cheng xu suo shi yong de gong neng , nin ke yi cong qing qiu guan xian zhong yi chu bu yong de mo kuai yi huo de shao xu de xing neng ti sheng 。 jian cha mei ge mo kuai ji qi gong neng , bing an nin de xu yao zi ding yi ta 。 li ru , ru guo nin zai ying yong cheng xu zhong bu shi yong hui hua zhuang tai he shu chu huan cun , ze ke yi cong lie biao zhong yi chu ta men , yi bian qing qiu zai bu zhi xing qi ta you yi yi de chu li shi , bu bi zhi xing mei ge mo kuai de jin ru he li kai dai ma 。   4. yi ding yao jin yong tiao shi mo shi       zai bu shu sheng chan ying yong cheng xu huo jin xing ren he xing neng ce liang zhi qian , shi zhong ji zhu jin yong tiao shi mo shi 。 ru guo qi yong le tiao shi mo shi , ying yong cheng xu de xing neng ke neng shou dao fei chang da de ying xiang 。      5. dui yu guang fan yi lai wai bu zi yuan de ying yong cheng xu , qing kao lv zai duo chu li qi ji suan ji shang qi yong wang luo yuan yi      ASP.NET jin cheng mo xing bang zhu qi yong duo chu li qi ji suan ji shang de ke suo fang xing , jiang gong zuo fen fa gei duo ge jin cheng ( mei ge CPU yi ge ), bing qie mei ge jin cheng dou jiang chu li qi guan xi she zhi wei qi CPU。 ci ji shu cheng wei wang luo yuan yi 。 ru guo ying yong cheng xu shi yong jiao man de shu ju ku fu wu qi huo tiao yong ju you wai bu yi lai xiang de COM dui xiang ( zhe li zhi shi ti ji liang zhong ke neng xing ), ze wei nin de ying yong cheng xu qi yong wang luo yuan yi shi you yi de 。 dan shi , zai jue ding qi yong wang luo yuan yi zhi qian , nin ying gai ce shi ying yong cheng xu zai wang luo yuan zhong de zhi xing qing kuang 。      6. zhi yao ke neng , jiu huan cun shu ju he ye shu chu      ASP.NET ti gong le yi xie jian dan de ji zhi , ta men hui zai bu xu yao wei mei ge ye qing qiu dong tai ji suan ye shu chu huo shu ju shi huan cun zhe xie ye shu chu huo shu ju 。 ling wai , tong guo she ji yao jin xing huan cun de ye he shu ju qing qiu ( te bie shi zai zhan dian zhong yu qi jiang you jiao da tong xun liang de qu yu ), ke yi you hua zhe xie ye de xing neng 。 yu .NET Framework de ren he Web chuang ti gong neng xiang bi , shi dang di shi yong huan cun ke yi geng hao de ti gao zhan dian de xing neng , you shi zhe zhong ti gao shi chao shu liang ji de 。 shi yong ASP.NET huan cun ji zhi you liang dian xu yao zhu yi 。 shou xian , bu yao huan cun tai duo xiang 。 huan cun mei ge xiang yun you kai xiao , te bie shi zai nei cun shi yong fang mian 。 bu yao huan cun rong yi chong xin ji suan he hen shao shi yong de xiang 。 qi ci , gei huan cun de xiang fen pei de you xiao qi bu yao tai duan 。 hen kuai dao qi de xiang hui dao zhi huan cun zhong bu bi yao de zhou zhuan , bing qie jing chang dao zhi geng duo de dai ma qing chu he la ji hui shou gong zuo 。 ruo guan xin ci wen ti , qing jian shi yu ASP.NET Applications xing neng dui xiang guan lian de Cache Total Turnover Rate xing neng ji shu qi 。 gao zhou zhuan lv ke neng shuo ming cun zai wen ti , te bie shi dang xiang zai dao qi qian bei yi chu shi 。 zhe ye cheng zuo nei cun ya li 。   7. xuan ze shi he ye mian huo ying yong cheng xu de shu ju cha kan ji zhi       gen ju nin xuan ze zai Web chuang ti ye xian shi shu ju de fang shi , zai bian li he xing neng zhi jian chang chang cun zai zhe chong yao de quan heng 。 li ru ,DataGrid Web fu wu qi kong jian ke neng shi yi zhong xian shi shu ju de fang bian kuai jie de fang fa , dan jiu xing neng er yan ta de kai xiao chang chang shi zui da de 。 zai mou xie jian dan de qing kuang xia , nin tong guo sheng cheng shi dang de HTML zi ji cheng xian shu ju ke neng hen you xiao , dan shi zi ding yi he liu lan qi ding xiang hui hen kuai di xiao suo huo de de e wai gong xiao 。Repeater Web fu wu qi kong jian shi bian li he xing neng de zhe zhong 。 ta gao xiao 、 ke zi ding yi qie ke bian cheng 。      8. jiang SqlDataReader lei yong yu kuai su zhi jin shu ju you biao      SqlDataReader lei ti gong le yi zhong du qu cong SQL Server shu ju ku jian suo de zhi jin shu ju liu de fang fa 。 ru guo dang chuang jian ASP.NET ying yong cheng xu shi chu xian yuan xu nin shi yong ta de qing kuang , ze SqlDataReader lei ti gong bi DataSet lei geng gao de xing neng 。 qing kuang zhi suo yi zhe yang , shi yin wei SqlDataReader shi yong SQL Server de ben ji wang luo shu ju chuan shu ge shi cong shu ju ku lian jie zhi jie du qu shu ju 。 ling wai ,SqlDataReader lei shi xian IEnumerable jie kou , gai jie kou ye yuan xu nin jiang shu ju bang ding dao fu wu qi kong jian 。 you guan geng duo xin xi , qing shen jian SqlDataReader lei 。 you guan ASP.NET ru he fang wen shu ju de xin xi , qing shen jian tong guo ASP.NET fang wen shu ju 。      9. jiang SQL Server cun chu guo cheng yong yu shu ju fang wen       zai .NET Framework ti gong de suo you shu ju fang wen fang fa zhong , ji yu SQL Server de shu ju fang wen shi sheng cheng gao xing neng 、 ke suo fang Web ying yong cheng xu de tui jian xuan ze 。 shi yong tuo guan SQL Server ti gong cheng xu shi , ke tong guo shi yong bian yi de cun chu guo cheng er bu shi te shu cha xun huo de e wai de xing neng ti gao 。      10. bi mian dan xian cheng dan yuan (STA) COM zu jian       mo ren qing kuang xia ,ASP.NET bu yuan xu ren he STA COM zu jian zai ye mian nei yun xing 。 ruo yao yun xing ta men , bi xu zai .aspx wen jian nei jiang ASPCompat=true shu xing bao han zai @ Page zhi ling zhong 。 zhe yang jiu jiang zhi xing yong de xian cheng chi qie huan dao STA xian cheng chi , er qie shi HttpContext he qi ta nei zhi dui xiang ke yong yu COM dui xiang 。 qian zhe ye shi yi zhong xing neng you hua , yin wei ta bi mian le jiang duo xian cheng dan yuan (MTA) feng song dao STA xian cheng de ren he tiao yong 。 shi yong STA COM zu jian ke neng da da sun hai xing neng , ying jin liang bi mian 。 ruo bi xu shi yong STA COM zu jian , ru zai ren he interop fang an zhong , ze ying zai zhi xing qi jian jin xing da liang tiao yong bing zai mei ci tiao yong qi jian fa song jin ke neng duo de xin xi 。 ling wai , xiao xin bu yao zai gou zao ye mian qi jian chuang jian ren he STA COM zu jian 。 li ru xia mian de dai ma zhong , zai ye mian gou zao shi jiang shi li hua you mou ge xian cheng chuang jian de MySTAComponent, er gai xian cheng bing bu shi jiang yun xing ye mian de STA xian cheng 。 zhe ke neng dui xing neng you bu li ying xiang , yin wei yao gou zao ye mian jiu bi xu wan cheng MTA he STA xian cheng zhi jian de feng song chu li 。   <%@ Page Language="VB" ASPCompat="true" %>   <script. runat=server>   Dim myComp as new MySTAComponent()   Public Sub Page_Load()   myComp.Name = "Bob"   End Sub   </script>   <html>   <% Response.Write(myComp.SayHello) %>  Response.Write(myComp.SayHello)   %>   </html>    shou xuan ji zhi shi tui chi dui xiang de chuang jian , zhi dao yi hou zai STA xian cheng xia zhi xing shang shu dai ma , ru xia mian de li zi suo shi 。   <%@ Page Language="VB" ASPCompat="true" %>   <script. runat=server>   Dim myComp   Public Sub Page_Load()   myComp = new MySTAComponent()   myComp.Name = "Bob"   End Sub   </script>   <html>   <% Response.Write(myComp.SayHello) %>  Response.Write(myComp.SayHello)   %>   </html>    tui jian de zuo fa shi zai xu yao shi huo zhe zai Page_Load fang fa zhong gou zao ren he COM zu jian he wai bu zi yuan 。 yong yuan bu yao jiang ren he STA COM zu jian cun chu zai ke yi you gou zao ta de xian cheng yi wai de qi ta xian cheng fang wen de gong xiang zi yuan li 。 zhe lei zi yuan bao kuo xiang huan cun he hui hua zhuang tai zhe yang de zi yuan 。 ji shi STA xian cheng tiao yong STA COM zu jian , ye zhi you gou zao ci STA COM zu jian de xian cheng neng gou shi ji wei gai tiao yong fu wu , er zhe yao qiu feng song chu li dui chuang jian zhe xian cheng de tiao yong 。 ci feng song chu li ke neng chan sheng chong da de xing neng sun shi he ke shen suo xing wen ti 。 zai zhe zhong qing kuang xia , qing yan jiu yi xia shi COM zu jian cheng wei MTA COM zu jian de ke neng xing , huo zhe geng hao de ban fa shi qian yi dai ma yi shi dui xiang cheng wei tuo guan dui xiang 。      11. jiang tiao yong mi ji xing de COM zu jian qian yi dao tuo guan dai ma      .NET Framework ti gong le yi ge jian dan de fang fa yu chuan tong de COM zu jian jin xing jiao hu 。 qi you dian shi ke yi zai bao liu xian you tou zi de tong shi li yong xin de ping tai 。 dan shi zai mou xie qing kuang xia , bao liu jiu zu jian de xing neng kai xiao shi de jiang zu jian qian yi dao tuo guan dai ma shi zhi de de 。 mei yi qing kuang dou shi bu yi yang de , jue ding shi fou xu yao qian yi zu jian de zui hao fang fa shi dui Web zhan dian yun xing xing neng ce liang 。 jian yi nin yan jiu yi xia ru he jiang xu yao da liang tiao yong yi jin xing jiao hu de ren he COM zu jian qian yi dao tuo guan dai ma 。 xu duo qing kuang xia bu ke neng jiang jiu shi zu jian qian yi dao tuo guan dai ma , te bie shi zai zui chu qian yi Web ying yong cheng xu shi 。 zai zhe zhong qing kuang xia , zui da de xing neng zhang ai zhi yi shi jiang shu ju cong fei tuo guan huan jing feng song dao tuo guan huan jing 。 yin ci , zai jiao hu cao zuo zhong , qing zai ren he yi duan zhi xing jin ke neng duo de ren wu , ran hou jin xing yi ge da tiao yong er bu shi yi xi lie xiao tiao yong 。 li ru , gong gong yu yan yun xing ku zhong de suo you zi fu chuan dou shi Unicode de , suo yi ying zai tiao yong tuo guan dai ma zhi qian jiang zu jian zhong de suo you zi fu chuan zhuan huan cheng Unicode ge shi 。 ling wai , yi chu li wan ren he COM dui xiang huo ben ji zi yuan jiu shi fang ta men 。 zhe yang , qi ta qing qiu jiu neng gou shi yong ta men , bing qie zui da xian du di jian shao le yin shao hou qing qiu la ji hui shou qi shi fang ta men suo yin qi de xing neng wen ti 。      12. zai Visual Basic .NET huo JScript. dai ma zhong shi yong zao qi bang ding       yi wang , kai fa ren yuan xi huan shi yong Visual Basic、VBScript. he JScript. de yuan yin zhi yi jiu shi ta men suo wei “ wu lei xing ” de xing zhi 。 bian liang bu xu yao xian shi lei xing sheng ming , bing neng gou jian dan di tong guo shi yong lai chuang jian ta men 。 dang cong yi ge lei xing dao ling yi ge lei xing jin xing fen pei shi , zhuan huan jiang zi dong zhi xing 。 bu guo , zhe zhong bian li hui da da sun hai ying yong cheng xu de xing neng 。Visual Basic xian zai tong guo shi yong Option Strict bian yi qi zhi ling lai zhi chi lei xing an quan bian cheng 。 wei le xiang hou jian rong , mo ren qing kuang xia ,ASP.NET bu qi yong gai xuan xiang 。 dan shi , wei le de dao zui jia xing neng , qiang lie jian yi zai ye zhong qi yong gai xuan xiang 。 ruo yao qi yong Option Strict, qing jiang Strict shu xing bao kuo zai @ Page zhi ling zhong , huo zhe , dui yu yong hu kong jian , qing jiang gai shu xing bao kuo zai @ Control zhi ling zhong 。 xia mian de shi li yan shi le ru he she zhi gai shu xing , bing jin xing le si ge bian liang tiao yong yi xian shi shi yong gai shu xing shi ru he dao zhi bian yi qi cuo wu de 。   <%@ Page Language="VB" Strict="true" %>   <% Dim B Dim C As String ' This will cause a compiler error. A = "Hello" ' This will cause a compiler error. B = "World" ' This will not cause a compiler error. C = "!!!!!!" ' But this will cause a compiler error. C = 0 %>  Dim B   Dim C As String   ' This will cause a compiler error.   A = "Hello"   ' This will cause a compiler error.   B = "World"   ' This will not cause a compiler error.   C = "!!!!!!"   ' But this will cause a compiler error.   C = 0   %> JScript. .NET ye zhi chi wu lei xing bian cheng , dan ta bu ti gong qiang zhi zao qi bang ding de bian yi qi zhi ling 。 ruo fa sheng xia mian ren he yi zhong qing kuang , ze bian liang shi wan qi bang ding de : bei xian shi sheng ming wei Object, shi wu lei xing sheng ming de lei de zi duan , shi wu xian shi lei xing sheng ming de zhuan yong han shu huo fang fa cheng yuan , bing qie wu fa cong qi shi yong tui duan chu lei xing 。    zui hou yi ge cha bie bi jiao fu duo , yin wei ru guo JScript. .NET bian yi qi ke yi gen ju bian liang de shi yong qing kuang tui duan chu lei xing , ta jiu hui jin xing you hua 。 zai xia mian de shi li zhong , bian liang A shi zao qi bang ding de , dan bian liang B shi wan qi bang ding de 。   var A;   var B;   A = "Hello";   B = "World";   B = 0; wei le huo de zui jia de xing neng , dang sheng ming JScript. .NET bian liang shi , qing wei qi fen pei yi ge lei xing 。 li ru ,var A : String。   13. shi qing qiu guan xian nei de suo you mo kuai jin ke neng gao xiao       qing qiu guan xian nei de suo you mo kuai zai mei ci qing qiu zhong dou you ji hui bei yun xing 。 yin ci , dang qing qiu jin ru he li kai mo kuai shi kuai su di chu fa dai ma zhi guan chong yao , te bie shi zai bu shi yong mo kuai gong neng de dai ma lu jing li 。 fen bie zai shi yong ji bu shi yong mo kuai he pei zhi wen jian shi zhi xing tun tu liang ce shi , dui que ding zhe xie fang fa de zhi xing su du fei chang you yong 。   14. shi yong HttpServerUtility.Transfer fang fa zai tong yi ying yong cheng xu de ye mian jian chong ding xiang       cai yong Server.Transfer yu fa , zai ye mian zhong shi yong gai fang fa ke bi mian bu bi yao de ke hu duan chong ding xiang 。   15. bi yao shi tiao zheng ying yong cheng xu mei ge fu zhu jin cheng de xian cheng shu      ASP.NET de qing qiu jie gou shi tu zai zhi xing qing qiu de xian cheng shu he ke yong zi yuan zhi jian da dao yi zhong ping heng 。 yi zhi yi ge shi yong zu gou CPU gong lv de ying yong cheng xu , gai jie gou jiang gen ju ke yong yu qing qiu de CPU gong lv , lai jue ding yuan xu tong shi zhi xing de qing qiu shu 。 zhe xiang ji shu cheng zuo xian cheng men kong 。 dan shi zai mou xie tiao jian xia , xian cheng men kong suan fa bu shi hen you xiao 。 tong guo shi yong yu ASP.NET Applications xing neng dui xiang guan lian de Pipeline Instance Count xing neng ji shu qi , ke yi zai PerfMon zhong jian shi xian cheng men kong 。 dang ye mian tiao yong wai bu zi yuan , ru shu ju ku fang wen huo XML Web services qing qiu shi , ye mian qing qiu tong chang ting zhi bing shi fang CPU。 ru guo mou ge qing qiu zheng zai deng dai bei chu li , bing qie xian cheng chi zhong you yi ge xian cheng shi zi you de , na me zhe ge zheng zai deng dai de qing qiu jiang kai shi bei chu li 。 yi han de shi , you shi zhe ke neng dao zhi Web fu wu qi shang cun zai da liang tong shi chu li de qing qiu he xu duo zheng zai deng dai de xian cheng , er ta men dui fu wu qi xing neng you bu li ying xiang 。 tong chang , ru guo men kong yin zi shi wai bu zi yuan de xiang ying shi jian , ze rang guo duo qing qiu deng dai zi yuan , dui Web fu wu qi de tun tu liang bing wu bang zhu 。 wei huan he zhe zhong qing kuang , ke yi tong guo geng gai Machine.config pei zhi wen jian jie dian de maxWorkerThreads he maxIOThreads shu xing , shou dong she zhi jin cheng zhong de xian cheng shu xian zhi 。       zhu yi : fu zhu xian cheng shi yong lai chu li ASP.NET qing qiu de , er IO xian cheng ze shi yong yu wei lai zi wen jian 、 shu ju ku huo XML Web services de shu ju ti gong fu wu de 。 fen pei gei zhe xie shu xing de zhi shi jin cheng zhong mei ge CPU mei lei xian cheng de zui da shu mu 。 dui yu shuang chu li qi ji suan ji , zui da shu shi she zhi zhi de liang bei 。 dui yu si chu li qi ji suan ji , zui da zhi shi she zhi zhi de si bei 。 wu lun ru he , dui yu you si ge huo ba ge CPU de ji suan ji , zui hao geng gai mo ren zhi 。 dui yu you yi ge huo liang ge chu li qi de ji suan ji , mo ren zhi jiu ke yi , dan dui yu you geng duo chu li qi de ji suan ji de xing neng , jin cheng zhong you yi bai huo liang bai ge xian cheng ze bi da yu li 。 zhu yi jin cheng zhong you tai duo xian cheng wang wang hui jiang di fu wu qi de su du , yin wei e wai de shang xia wen jiao huan dao zhi cao zuo xi tong jiang CPU zhou qi hua zai wei hu xian cheng er bu shi chu li qing qiu shang 。      16. shi dang di shi yong gong gong yu yan yun xing ku de la ji hui shou qi he zi dong nei cun guan li       xiao xin bu yao gei mei ge qing qiu fen pei guo duo nei cun , yin wei zhe yang la ji hui shou qi jiang bi xu geng pin fan di jin xing geng duo de gong zuo 。 ling wai , bu yao rang bu bi yao de zhi zhen zhi xiang dui xiang , yin wei ta men jiang shi dui xiang bao chi huo dong zhuang tai , bing qie ying jin liang bi mian han Finalize fang fa de dui xiang , yin wei ta men zai hou mian hui dao zhi geng duo de gong zuo 。 te bie shi zai Finalize tiao yong zhong yong yuan bu yao shi fang zi yuan , yin wei zi yuan zai bei la ji hui shou qi hui shou zhi qian ke neng yi zhi xiao hao zhe nei cun 。 zui hou zhe ge wen ti jing chang hui dui Web fu wu qi huan jing de xing neng zao cheng hui mie xing de da ji , yin wei zai deng dai Finalize yun xing shi , hen rong yi hao jin mou ge te ding de zi yuan 。      17. ru guo you da xing Web ying yong cheng xu , ke kao lv zhi xing yu pi bian yi       mei dang fa sheng dui mu lu de di yi ci qing qiu shi dou hui zhi xing pi bian yi 。 ru guo mu lu zhong de ye mian mei you bei fen xi bing bian yi , ci gong neng hui cheng pi fen xi bing bian yi mu lu zhong de suo you ye mian , yi bian geng hao di li yong ci pan he nei cun 。 ru guo zhe xu yao hen chang shi jian , ze jiang kuai su fen xi bing bian yi dan ge ye mian , yi bian qing qiu neng bei chu li 。 ci gong neng dai gei ASP.NET xing neng shang de hao chu , yin wei ta jiang xu duo ye mian bian yi wei dan ge cheng xu ji 。 cong yi jia zai de cheng xu ji fang wen yi ye bi mei ye jia zai xin de cheng xu ji yao kuai 。 pi bian yi de que dian zai yu : ru guo fu wu qi jie shou dao xu duo dui shang wei bian yi de ye mian de qing qiu , na me dang Web fu wu qi fen xi bing bian yi ta men shi , xing neng ke neng jiao cha 。 wei jie jue zhe ge wen ti , ke yi zhi xing yu pi bian yi 。 wei ci , zhi xu zai ying yong cheng xu ji huo zhi qian xiang ta qing qiu yi ge ye mian , wu lun na ye yun ke 。 ran hou , dang yong hu shou ci fang wen nin de zhan dian shi , ye mian ji qi cheng xu ji jiang yi bei bian yi 。 mei you jian dan de ji zhi ke yi zhi dao pi bian yi he shi fa sheng 。 xu yi zhi deng dao CPU kong xian huo zhe mei you geng duo de bian yi qi jin cheng ( li ru csc.exe(C# bian yi qi ) huo vbc.exe(Visual Basic bian yi qi )) qi dong 。 huan ying jin liang bi mian geng gai ying yong cheng xu de bin mu lu zhong de cheng xu ji 。 geng gai ye mian hui dao zhi chong xin fen xi he bian yi gai ye , er ti huan bin mu lu zhong de cheng xu ji ze hui dao zhi wan quan chong xin pi bian yi gai mu lu 。 zai bao han xu duo ye mian de da gui mo zhan dian shang , geng hao de ban fa ke neng shi gen ju ji hua ti huan ye mian huo cheng xu ji de pin fan cheng du lai she ji bu tong de mu lu jie gou 。 bu chang geng gai de ye mian ke yi cun chu zai tong yi mu lu zhong bing zai te ding de shi jian jin xing yu pi bian yi 。 jing chang geng gai de ye mian ying zai ta men zi ji de mu lu zhong ( mei ge mu lu zui duo ji bai ye ) yi bian kuai su bian yi 。Web ying yong cheng xu ke yi bao han xu duo zi mu lu 。 pi bian yi fa sheng zai mu lu ji , er bu shi ying yong cheng xu ji 。   18. bu yao yi lai dai ma zhong de yi chang       yin wei yi chang da da di jiang di xing neng , suo yi nin bu ying gai jiang ta men yong zuo kong zhi zheng chang cheng xu liu cheng de fang shi 。 ru guo you ke neng jian ce dao dai ma zhong ke neng dao zhi yi chang de zhuang tai , qing zhi xing zhe zhong cao zuo 。 bu yao zai chu li gai zhuang tai zhi qian bu huo yi chang ben shen 。 chang jian de fang an bao kuo : jian cha null, fen pei gei jiang fen xi wei shu zi zhi de String yi ge zhi , huo zai ying yong shu xue yun suan qian jian cha te ding zhi 。 xia mian de shi li yan shi ke neng dao zhi yi chang de dai ma yi ji ce shi shi fou cun zai mou zhong zhuang tai de dai ma 。 liang zhe chan sheng xiang tong de jie guo 。   try   {   result = 100 / num;   }   catch (Exception e)   {   result = 0;   }   // ...to this.   if (num != 0)   result = 100 / num;   else   result = 0;   19. shi yong HttpResponse.Write fang fa jin xing zi fu chuan chuan lian    gai fang fa ti gong fei chang you xiao de huan chong he lian jie fu wu 。 dan shi , ru guo nin zheng zai zhi xing guang fan de lian jie , qing shi yong duo ge Response.Write tiao yong 。 xia mian shi li zhong xian shi de ji shu bi yong dui Response.Write fang fa de dan ge tiao yong lian jie zi fu chuan geng kuai 。   Response.Write("a");   Response.Write(myString);   Response.Write("b");   Response.Write(myObj.ToString());   Response.Write("c");   Response.Write(myString2);   Response.Write("d");   20. chu fei you te shu de yuan yin yao guan bi huan chong , fou ze shi qi bao chi da kai    jin yong Web chuang ti ye de huan chong hui dao zhi da liang de xing neng kai xiao 。      21. zhi zai bi yao shi bao cun fu wu qi kong jian shi tu zhuang tai       zi dong shi tu zhuang tai guan li shi fu wu qi kong jian de gong neng , gai gong neng shi fu wu qi kong jian ke yi zai wang fan guo cheng shang chong xin tian chong ta men de shu xing zhi ( nin bu xu yao bian xie ren he dai ma )。 dan shi , yin wei fu wu qi kong jian de shi tu zhuang tai zai yin cang de chuang ti zi duan zhong wang fan yu fu wu qi , suo yi gai gong neng que shi hui dui xing neng chan sheng ying xiang 。 nin ying gai zhi dao zai na xie qing kuang xia shi tu zhuang tai hui you suo bang zhu , zai na xie qing kuang xia ta ying xiang ye de xing neng 。 li ru , ru guo nin jiang fu wu qi kong jian bang ding dao mei ge wang fan guo cheng shang de shu ju , ze jiang yong cong shu ju bang ding cao zuo huo de de xin zhi ti huan bao cun de shi tu zhuang tai 。 zai zhe zhong qing kuang xia , jin yong shi tu zhuang tai ke yi jie sheng chu li shi jian 。 mo ren qing kuang xia , wei suo you fu wu qi kong jian qi yong shi tu zhuang tai 。 ruo yao jin yong shi tu zhuang tai , qing jiang kong jian de EnableViewState shu xing she zhi wei false, ru xia mian de DataGrid fu wu qi kong jian shi li suo shi 。   <asp:datagrid EnableViewState="false" datasource="..." runat="server"/>    nin huan ke yi shi yong @ Page zhi ling jin yong zheng ge ye de shi tu zhuang tai 。 dang nin bu cong ye hui fa dao fu wu qi shi , zhe jiang shi fen you yong :   <%@ Page EnableViewState="false" %>    zhu yi :@ Control zhi ling zhong ye zhi chi EnableViewState shu xing , gai zhi ling yuan xu nin kong zhi shi fou wei yong hu kong jian qi yong shi tu zhuang tai 。 ruo yao fen xi ye shang fu wu qi kong jian shi yong de shi tu zhuang tai de shu liang , qing ( tong guo jiang trace="true" shu xing bao kuo zai @ Page zhi ling zhong ) qi yong gai ye de gen zong bing cha kan Control Hierarchy biao de Viewstate lie 。 you guan gen zong he ru he qi yong ta de xin xi , qing shen jian ASP.NET gen zong 。   22. bi mian dao fu wu qi de bu bi yao de wang fan guo cheng       sui ran nin hen ke neng xi wang jin liang duo di shi yong Web chuang ti ye kuang jia de na xie jie sheng shi jian he dai ma de gong neng , dan zai mou xie qing kuang xia que bu yi shi yong ASP.NET fu wu qi kong jian he hui fa shi jian chu li 。 tong chang , zhi you zai jian suo huo cun chu shu ju shi , nin cai xu yao qi dong dao fu wu qi de wang fan guo cheng 。 duo shu shu ju cao zuo ke zai zhe xie wang fan guo cheng jian de ke hu duan shang jin xing 。 li ru , cong HTML chuang ti yan zheng yong hu shu ru jing chang ke zai shu ju ti jiao dao fu wu qi zhi qian zai ke hu duan jin xing 。 tong chang , ru guo bu xu yao jiang xin xi chuan di dao fu wu qi yi jiang qi cun chu zai shu ju ku zhong , na me nin bu ying gai bian xie dao zhi wang fan guo cheng de dai ma 。 ru guo nin kai fa zi ding yi fu wu qi kong jian , qing kao lv rang ta men wei zhi chi ECMAScript. de liu lan qi cheng xian ke hu duan dai ma 。 tong guo yi zhe zhong fang shi shi yong fu wu qi kong jian , nin ke yi xian zhu di jian shao xin xi bei bu bi yao de fa song dao Web fu wu qi de ci shu 。    shi yong Page.IsPostBack bi mian dui wang fan guo cheng zhi xing bu bi yao de chu li    ru guo nin bian xie chu li fu wu qi kong jian hui fa chu li de dai ma , you shi ke neng xu yao zai shou ci qing qiu ye shi zhi xing qi ta dai ma , er bu shi dang yong hu fa song bao han zai gai ye zhong de HTML chuang ti shi zhi xing de dai ma 。 gen ju gai ye shi fou shi xiang ying fu wu qi kong jian shi jian sheng cheng de 。    shi yong Page.IsPostBack shu xing you tiao jian di zhi xing dai ma    li ru , xia mian de dai ma yan shi ru he chuang jian shu ju ku lian jie he ming ling , gai ming ling zai shou ci qing qiu gai ye shi jiang shu ju bang ding dao DataGrid fu wu qi kong jian 。   void Page_Load(Object sender, EventArgs e)   {   // Set up a connection and command here.   if (!Page.IsPostBack)   {   String query = "select * from Authors where FirstName like '%JUSTIN%'";   myCommand.Fill(ds, "Authors");   myDataGrid.DataBind();   }   }    you yu mei ci qing qiu shi dou zhi xing Page_Load shi jian , shang shu dai ma jian cha IsPostBack shu xing shi fou she zhi wei false。 ru guo shi , ze zhi xing dai ma 。 ru guo gai shu xing she zhi wei true, ze bu zhi xing dai ma 。 zhu yi ru guo bu yun xing zhe zhong jian cha , hui fa ye de xing wei jiang bu geng gai 。Page_Load shi jian de dai ma zai zhi xing fu wu qi kong jian shi jian zhi qian zhi xing , dan zhi you fu wu qi kong jian shi jian de jie guo cai ke neng zai shu chu ye shang cheng xian 。 ru guo bu yun xing gai jian cha , reng jiang wei Page_Load shi jian he gai ye shang de ren he fu wu qi kong jian shi jian zhi xing chu li 。      23. dang bu shi yong hui hua zhuang tai shi jin yong ta       bing bu shi suo you de ying yong cheng xu huo ye dou xu yao zhen dui yu ju ti yong hu de hui hua zhuang tai , nin ying gai dui ren he bu xu yao hui hua zhuang tai de ying yong cheng xu huo ye jin yong hui hua zhuang tai 。    ruo yao jin yong ye de hui hua zhuang tai , qing jiang @ Page zhi ling zhong de EnableSessionState shu xing she zhi wei false。 li ru :   <%@ Page EnableSessi %>    zhu yi : ru guo ye xu yao fang wen hui hua bian liang , dan bu da suan chuang jian huo xiu gai ta men , ze jiang @ Page zhi ling zhong de EnableSessionState shu xing she zhi wei ReadOnly。 huan ke yi jin yong XML Web services fang fa de hui hua zhuang tai 。 you guan geng duo xin xi , qing shen jian shi yong ASP.NET he XML Web services ke hu duan chuang jian de XML Web services。 ruo yao jin yong ying yong cheng xu de hui hua zhuang tai , qing zai ying yong cheng xu Web.config wen jian de sessionstate pei zhi jie zhong jiang mode shu xing she zhi wei off。 li ru :   <sessionstate mode="off" />   24. zai xi xuan ze hui hua zhuang tai ti gong cheng xu      ASP.NET wei cun chu ying yong cheng xu de hui hua shu ju ti gong le san zhong bu tong de fang fa : jin cheng nei hui hua zhuang tai 、 zuo wei Windows fu wu de jin cheng wai hui hua zhuang tai he SQL Server shu ju ku zhong de jin cheng wai hui hua zhuang tai 。 mei zhong fang fa dou you zi ji de you dian , dan jin cheng nei hui hua zhuang tai shi qi jin wei zhi su du zui kuai de jie jue fang an 。 ru guo zhi zai hui hua zhuang tai zhong cun chu shao liang yi shi shu ju , ze jian yi nin shi yong jin cheng nei ti gong cheng xu 。 jin cheng wai jie jue fang an zhu yao yong yu kua duo ge chu li qi huo duo ge ji suan ji suo fang ying yong cheng xu , huo zhe yong yu fu wu qi huo jin cheng chong xin qi dong shi bu neng diu shi shu ju de qing kuang 。 you guan geng duo xin xi , qing shen jian ASP.NET zhuang tai guan li 。      25. bu shi yong bu bi yao de Server Control   ASP.net zhong , da liang de fu wu qi duan kong jian fang bian le cheng xu kai fa , dan ye ke neng dai lai xing neng de sun shi , yin wei yong hu mei cao zuo yi ci fu wu qi duan kong jian , jiu chan sheng yi ci yu fu wu qi duan de wang fan guo cheng 。 yin ci , fei bi yao , ying dang shao shi yong Server Control。      26. ASP.NET ying yong cheng xu xing neng ce shi       zai dui ASP.NET ying yong cheng xu jin xing xing neng ce shi zhi qian , ying que bao ying yong cheng xu mei you cuo wu , er qie gong neng zheng que 。 ju ti de xing neng ce shi ke yi cai yong yi xia gong ju jin xing :Web Application Strees Tool (WAS) shi Microsoft fa bu de yi ge mian fei ce shi gong ju , ke yi cong [url=http://webtool.rte.microsoft.com/]http://webtool.rte.microsoft.com/[/url] shang xia zai 。 ta ke yi mo ni cheng bai shang qian ge yong hu tong shi dui web ying yong cheng xu jin xing fang wen qing qiu , zai fu wu qi shang xing cheng liu liang fu zai , cong er da dao ce shi de mu de , ke yi sheng cheng ping yun TTFB、 ping yun TTLB deng xing neng hui zong bao gao 。Application Center Test (ACT) shi yi ge ce shi gong ju , fu dai yu Visual Studio.NET de qi ye ban zhong , shi Microsoft zheng shi zhi chi de web ying yong cheng xu ce shi gong ju 。 ta neng gou zhi guan di sheng cheng tu biao jie guo , gong neng bi WAS duo , dan bu ju bei duo ge ke hu ji tong shi ce shi de neng li 。 fu wu qi cao zuo xi tong " guan li gong ju " zhong de " xing neng " ji shu qi , ke yi dui fu wu qi jin xing jian ce yi le jie ying yong cheng xu xing neng 。       jie lun :    dui yu wang zhan kai fa ren yuan lai shuo , zai bian xie ASP.NET ying yong cheng xu shi zhu yi xing neng wen ti , yang cheng liang hao de xi guan , ti gao ying yong cheng xu xing neng , zhi shao ke yi tui chi bi xu de ying jian sheng ji , jiang di wang zhan de cheng ben 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有