ASP.NET(C#)ÖÐstringÓëstringBuilderµÄÇø±ð
ÔÚÏàͬ×Ö·û´®µÄÐí¶à²Ù×÷ÉÏ£¬Ê¹ÓÃStringBuilderÀà»á±ÈʹÓÃString¶ÔÏó¸üÓÐЧÂÊ¡£
µ±Äã¶ÔÒ»¸östring¶ÔÏó¸³ÖµÊ±£¬Õâʱ»áÉú³ÉÒ»¸öÕâ¸ö¶ÔÏóµÄ¸±±¾£¬Èç¹ûÄ㸳ֵ¶à´ÎµÄ»°ÔÚϵͳÖоͻᱣ´æ¶à¸öÕâ¸ö¶ÔÏóµÄ¸±±¾£¬»á¶Ôϵͳ×ÊÔ´Ôì³ÉºÜ´óµÄÀË·Ñ£¬µ«ÊÇStringBuilder²»»á³öÏÈÉÏÊöÇé¿ö
StringÊý¾ÝÀàÐÍ´ú±íµÄÊÇÒ»ÖÖ²»¿É±äµÄ×Ö·û´®£¬ ÒÔΪ×ŶÔÕâ¸ö×Ö·û´®µÄ²åÈ룬 ɾ³ý»òÊǸü¸Ä£¬Î¨Ò»µÄ·½Ê½¾ÍÊǽ¨Á¢Ò»¸öеÄ×Ö·û´®£¬»áÒý·¢¶ÔÄÚ´æµÄÅäÖòÙ×÷ÒÔ¼°¶ÔÄÚ´æµÄ·´ÅäÖòÙ×÷£¬¼ÓÖØCLR¹ÜÀíÄÚ´æºÍÄÚ´æ»ØÊյŤ×÷£¬ÕâÖÐÇéÐÎÓÈÆäÊÇÔÚ²Ù×÷´ó×Ö·û´®Ê±£¬¸üΪÃ÷ÏÔ£¬ÔÚµ¥Ò»µÄÓû§»·¾³ÖУ¬²»»á´øÀ´ÈκÎÎÊÌ⣬µ«ÊÇÔÚ·þÎñÆ÷»·¾³ÖУ¬ÔÚЧÄܺͿÉÀ©Õ¹ÐÔÉÏ»áÔì³É±È½ÏÑÏÖصÄÎÊÌâ¡£
ÓëSystem.StringÏà±È£¬StringBuilder»á±£Áô×Ô¼ºµÄ×Ö·û´®»º³åÇø£¬ÔÚÕë¶ÔStringBuilderÖ´ÐÐ×Ö·û´®²Ù×÷ʱ£¬»áÏȼì²é»º³åÇøµÄ´óСÊÇ·ñÄÜ·ñÈÝÄÉеÄ×Ö·û´®£¬²»¹»Ê±ÔÙÈ¥Ôö¼ÓÐèÒªµÄÄÚ´æÊýÁ¿£¬Òò´Ë´ó·ù½µµÍÄÚ´æÅäÖõIJÙ×÷´ÎÊý£¬Ìá¸ßÁËЧÄÜ£¬µ±È»´ó¶àÊýµÄÇé¿öÏ£¬¶à¹ÀËãһЩ»º³åÇø¿Õ¼ä±ÈºóÀ´ÓÖ²»¶Ï¼Ó´óÒªºÃ¡£
±ÈÈ磺string+=string»áÕ¼Óøü¶àµÄÄÚ´æ·ÖÅä¡£×îºÃʹÓÃstringbuilder.append
Ïà¹ØÎĵµ£º
ASP.NET MVC ¶àÓïÑÔ½â¾ö·½°¸()
¾ÍÒ»¸öÍøÕ¾µÄ¶àÓïÑÔÌØÐÔÀ´Ëµ£¬ÎÒÈÏΪ·ÖΪÁ½¸ö·½Ã棺
1¡¢HTML½çÃæÉÏÏÔʾµÄÎÄ×ÖÐèÒª¶àÓïÑÔ
2¡¢HTML½çÃæÉÏJSÊä³öµÄÎÄ×ÖÐèÒª¶àÓïÑÔ
ÔÀ´ÔÚHTML²¿·ÖÖ±½ÓдµÄÎÄ×Ö¶¼²»ÄÜÖ±½ÓдҪÊä³öµÄÎÄ×Ö£¬¶øÊÇÒª²ÉÓñê¼ÇµÄ·½·¨À´Ìæ»»¡£JSÒ² ......
#(¶Á×ö "C sharp")ÊÇ΢Èí¹«Ë¾ÔÚÈ¥ÄêÁùÔ·¢²¼µÄÒ»ÖÖеıà³ÌÓïÑÔ,²¢¶¨ÓÚÔÚ΢ÈíÖ°Òµ¿ª·¢ÕßÂÛ̳(PDC)ÉϵÇ̨ÁÁÏà.C#ÊÇ΢Èí¹«Ë¾Ñо¿Ô±Anders HejlsbergµÄ×îгɹû.C#¿´ÆðÀ´ÓëJavaÓÐמªÈ˵ÄÏàËÆ;Ëü°üÀ¨ÁËÖîÈçµ¥Ò»¼Ì³Ð,½çÃæ,ÓëJava¼¸ºõͬÑùµÄÓï·¨,ºÍ±àÒë³ÉÖмä´úÂëÔÙÔËÐеĹý³Ì.µ«ÊÇC#ÓëJavaÓÐ×ÅÃ÷ÏԵIJ»Í¬,Ëü½è¼øÁËDelphiµÄÒ»¸ ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using  ......
ÕâÁ½ÌìÒòΪҪ×öÒ»¸ö¿ÉÒÔÊÕ¼¯Óû§Ìá½»ÐÅÏ¢£¬È»ºó·¢ËÍÓʼþµ½Ö¸¶¨ÓÊÏäµÄÍøÒ³¡£ÔÚ asp.net 2.0 ÀïÃæ·¢ËÍÓʼþ¿ÉÒÔʹÓà System.Net.Mail ÏÂÃæµÄÀà¡£http://www.systemnetmail.com/faq/2.1.aspx Õâ¸öµØÖ·ÓÐ System.Net.Mail µÄ×÷ÕßдµÄ·Â·ðÊÇ MSDN ÀàËÆµÄ Faq£¬¿´´úÂëµÄʱºò¿ÉÒԲο¼ÒÔÏ¡£Ê²Ã´¶¼²»ËµÁË£¬ÏÂÃæÌù³öÀ´´úÂë°É£¬±Ï¾¹´ú ......
asp.net´°ÌåµÄ´ò¿ªºÍ¹Ø±Õ
//´ò¿ªÐµĴ°Ìå
Response.Redirect("WebMain.aspx");
//µ¯³öÒ»¸öд°Ìå
Response.Write("<script>window.open(\"WebMain.aspx\")</script>")
//µ¯³öÒ»¸öÖ»ÓÐÈ·¶¨°´Å¥µÄÌáʾ¿ò
Response.Write("<script>alert(\"Óû§Ãû»òÃÜÂë´íÎó\");</script>") ......