ÔÚasp.netÖÐ×Ô¶¯¸øurlµØÖ·¼ÓÉϳ¬Á´½Ó
ÒªÏë×Ô¶¯ÏÔʾ³¬Á´½ÓµÄ¹Ø¼üÔÚÓÚÈçºÎÄÜÕýȷʶ±ð³¬Á´½Ó£¬ºÁÎÞÒÉÎʵģ¬×îÓÐЧµÄ·½·¨ÊÇÓÃÕýÔò±í´ïʽ¡£ÕýÔò±í´ïʽÊÇÓÉÆÕͨ×Ö·û£¨ÀýÈç×Ö·û a µ½ z£©ÒÔ¼°ÌØÊâ×Ö·û£¨³ÆΪԪ×Ö·û£©×é³ÉµÄÎÄ×Öģʽ£¬ÃèÊöÁËÒ»ÖÖ×Ö·û´®Æ¥ÅäµÄģʽ£¬¿ÉÒÔÓÃÀ´¼ì²éÒ»¸ö´®ÊÇ·ñº¬ÓÐijÖÖ×Ó´®¡¢½«Æ¥ÅäµÄ×Ó´®×öÌæ»»»òÕß´Óij¸ö´®ÖÐÈ¡³ö·ûºÏij¸öÌõ¼þµÄ×Ó´®µÈ¡£.net»ù´¡Àà¿âÖаüº¬ÓÐÒ»¸öÃû×Ö¿Õ¼äºÍһϵÁпÉÒÔ³ä·Ö·¢»Ó¹æÔò±í´ïʽÍþÁ¦µÄÀ࣬ÓÃËü¾Í¿ÉÒÔ×Ô¶¯Ì½²â³öÎÄ×ÖÖеÄurlÁ´½Ó»òemailµØÖ·¡£ÏÂÃæÎÒ¾ßÌå½²½²ÈçºÎÓÃasp.net(c#)Ò»²½²½ÊµÏÖÎÒÃǵÄÄ¿µÄ£º
Ê×ÏÈ£¬ÒªÏëÔÚasp.net(c#)ÖÐʹÓÃÕýÔò±í´ïʽ¾Í±ØÐë°Ñ system.text.regularexpressions Õâ¸öÃüÃû¿Õ¼ä°üº¬½øÀ´£º
using system.text.regularexpressions;
µÚ¶þ²½ÊÇÓÃÕýÔò±í´ïʽʶ±ðurl³¬Á´½Ó£º
regex urlregex = new regex(@"(http:\/\/([\w.]+\/@)\s*)",
regexoptions.ignorecase|regexoptions.compiled);
ÕâÀïµÄ´úÂëÊÇÓÃÕýÔò±í´ïʽʶ±ðemailµØÖ·£º
regex emailregex = new regex(@"([a-za-z_0-9.-]+\@[a-za-z_0-9.-]+\.\w+)",
regexoptions.ignorecase|regexoptions.compiled);
µÚÈý²½£¬µ±³ÌÐòÒѾʶ±ð³öurl³¬Á´½Ó»òemailµØÖ·ºó£¬±ØÐëÓÃ<a href=/knowskycom/...>³¬Á´½Ó</a>¶ÔÕâЩ³¬Á´½Ó½øÐÐÌæ»»£¬ÕâÑù²ÅÄÜ°ÑÕâЩÎÄ×ÖÏÔʾΪÁ´½ÓµÄÐÎʽ¡£ÎÒÕâÀï°ÑËüÃÇÈ«²¿°üº¬ÔÚº¯ÊýÖУº
private void button1_click(object sender, system.eventargs e)
{
string strcontent = inputtextbox.text;
regex urlregex = new regex(@"(http:\/\/([\w.]+\/@)\s*)",
regexoptions.ignorecase| regexoptions.compiled);
strcontent = urlregex.replace(strcontent,
"<a href=/knowskycom/\"\" target=\"_blank\"></a>");
regex emailregex = new regex(@"([a-za-z_0-9.-]+\@[a-za-z_0-9.-]+\.\w+)",
regexoptions.ignorecase| regexoptions.compiled);
strcontent = emailregex.replace(strcontent, "mailto:></a>");
lbcontent.text += "<br&
Ïà¹ØÎĵµ£º
ASP.NETÊÇÒ»¸ö·Ç³£Ç¿´óµÄ¹¹½¨WebÓ¦ÓõÄƽ̨£¬ËüÌṩÁ˼«´óµÄÁé»îÐÔºÍÄÜÁ¦ÒÔÖÂÓÚ¿ÉÒÔÓÃËüÀ´¹¹½¨ËùÓÐÀàÐ͵ÄWebÓ¦Óá£
¾ø´ó¶àÊýµÄÈËÖ»ÊìϤ¸ß²ãµÄ¿ò¼ÜÈ磺 WebForms ºÍ WebServices --ÕâЩ¶¼ÔÚASP.NET²ã´Î½á¹¹ÔÚ×î¸ß²ã¡£
ÕâƪÎÄÕµÄ×ÊÁÏÊÕ¼¯ÕûÀí×Ô¸÷ÖÖ΢Èí¹«¿ªµÄÎĵµ£¬Í¨¹ý±È½Ï IIS5¡¢IIS6¡¢IIS7 ÕâÈý´ú IIS ¶ÔÇëÇóµÄ´¦Àí¹ý³ ......
ÔÚBSÏîÄ¿ÖУ¬Ä³¸öaspxÒ³ÃæÐèÒªÒýÓÃÍⲿ½Å±¾Îļþ£¬Í¨¹ýÔÚÒ³Ãæhead½Ú<script language="" src="">·½Ê½ÒýÓÃÖ¸¶¨µÄjsÖ®ºó£¬ÈÔÈ»ÎÞЧ¡£Í¨¹ýalert·½Ê½µ÷ÊÔ£¬·¢ÏÖÊÇÓÉÓÚjsÎļþ±àÂëÓëjsÎļþÄÚÈݲ»·û¡£ÓÉÓÚjsÎļþÖаüº¬ÖÐÎÄ×¢ÊÍ£¬ËùÒÔÐèÒªÉèÖÃjsÎļþΪ¿Éʶ±ðÖÐÎĵÄgb2312±àÂë¡£Æä·½·¨ÔÚÍøÉÏÒ²½²Êö£¬ÒÔÏÂΪÍøÕªÄÚÈÝ£º
&n ......
ÒÔÇ°×ö.NET winformµÄʱºò£¬Ò»Ö±¶¼ÊÇÓà Console.WriteÏò¿ØÖÆ̨Êä³öÐÅÏ¢µÄ£¬Õâ´Î×öwebµÄʱºò£¬·¢ÏÖÕâ¸öÓï¾äÓò»ÁË¡£
²éÁËÒ»ÏÂ×ÊÁÏ£¬²Å·¢ÏÖweb³ÌÐòÖ´ÐÐʱ£¬ÊDZ»¸½¼Óµ½IIS½ø³ÌµÄÒ»¸öµ¥¶ÀµÄAppDomainÖеģ¬ËùÒÔ¾ÍËãÓÐÊä³öÒ²¿´µ½£¬ËùÒÔConsole.Writeµ÷ÊÔÐÅÏ¢ÎÞ·¨ÏÔʾ³öÀ´¡£
ÄÇô½â¾ö°ì·¨ÊÇ£¬ÓÃdebug´úÌ棺
System.Diagnostics ......
Web ÊÇ»ùÓÚÎÞ״̬µÄhttpÐÒ飬ASP.NET ΪÁ˱£Ö¤¿Ø¼þÔÚÒ³Ãæ´«Ë͵½·þÎñÆ÷£¬ÔÙ´Ó·þÎñÆ÷·¢»Øµ½Ò³ÃæµÄʱ±£³Ö֮ǰµÄ״̬¡£
´úÂë×¼±¸£º
ÔÚaspxÒ³ÃæÉÏÌí¼ÓÒ»¸ölistbox¿Ø¼þ£¬ºÍÒ»¸öbutton·þÎñÆ÷¿Ø¼þ£º
<
asp:ListBox runat
=
"
server
"
ID
=
"
lbViewState
"
></
asp ......
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 ......