ASP.NET vs. PHP£¬Äĸö¸ü¿ì£¿
ASP.NET vs. PHP£¬Äĸö¸ü¿ì£¿
http://www.infoq.com/cn/news/2009/09/aspnet-php-benchmark
×÷Õß ÕÔ劼 ·¢²¼ÓÚ 2009Äê9ÔÂ15ÈÕ ÉÏÎç5ʱ33·Ö
ÉçÇø .NET Ö÷Ìâ ÐÔÄܺͿÉÉìËõÐÔ ±êÇ© PHP, ASP.NET
½áÂÛ£º
ÎÒÃÇ¿ÉÒÔÕâôÈÏΪ£¬¶ÔÓÚ´¿´âµÄPHPÖ´ÐÐÐÔÄÜÀ´Ëµ£¬LinuxºÍWindowsÏà²îÎÞ¼¸£¬Õâ²»»á³ÉΪѡÔñLinux»òWindows×÷Ϊ²¿Êðƽ̨µÄ¾ö¶¨ÐÔÒòËØ¡£
Èç¹ûÄãÔÚ¹¹½¨Ò»¸öÓ¦ÓóÌÐò£¬ÄÇôPostgreSQL¿ÉÄÜÊǸüºÃµÄÑ¡Ôñ¡£ÒòΪËüÔÚÁ½¸öƽ̨ÉϵıíÏÖ¶¼ºÜÓÅÐã¡£
Èç¹ûÄãµÄÓ¦ÓóÌÐò±ØÐëʹÓÃMySQL£¬ÄÇôѡÔñWindows¾ÍÐèÒªÔçЩ¼Æ»®À©Õ¹ÐÔÎÊÌâÁË£¨¸öÈËÈÏΪSun²»Ì«¿ÉÄÜΪWindowsÓÅ»¯MySQLµÄÐÔÄÜ£©¡£
PHPµÄµÚÒ»¸ö°æ±¾µÄSQL ServerÇý¶¯³ÌÐòÒª±ÈMySQL»òPostpreSQLÒªÂýһЩ£¬µ«ÕâÓ¦¸Ã²»»á³ÉΪÎÊÌâ¡£µÚ¶þ¸ö°æ±¾µÄÇý¶¯Æ÷ÕýÔÚ¿ª·¢Ö®ÖУ¬Ëü»á´øÀ´ÐÔÄÜÌáÉý¡£
----»ð÷è÷ë¸öÈ˾õµÃ²»¸ÃÓûº´æÀ´±È£¬»º´æµÄ¶¼ÊǾ²Ì¬Ò³Ã棬ÔÚ´óÁ¿ÍøÕ¾·ÃÎÊÏÂÓÐÓ㬵«ÊDZȽ϶¯Ì¬ÔËËãËٶȱȻº´æûÓÐÒâÒåµÄ
ÉϸöÔÂJoe StagnerÔÚ²©¿ÍÉÏ·¢±íÁËһϵÁÐÎÄÕ±ȽÏÁËPHPºÍASP.NETµÄÖ´ÐÐÐÔÄÜ£¬ÒýÆðÁËÀ´×ÔË«·½³ÌÐòÔ±µÄ´óÁ¿»ØÓ¦¡£Joe±íʾ£¬Ëû»á½«ÕâÑùµÄ²âÊÔ³ÖÐøÏÂÈ¥£¬²¢Ñ°Çó¸üΪºÏÊʵķ½Ê½£¬ÒÔ»ñµÃ¶Ôʵ¼ÊÏîÄ¿À´Ëµ¾¡¿ÉÄÜÓвο¼¼ÛÖµµÄ½áÂÛ¡£
Joe±íʾ£º
Ò»°ãÀ´Ëµ£¬×÷ÐÔÄܲâÊÔµÄÄ¿µÄÊÇÒª³¢ÊÔÖ¤Ã÷Ò»·½±ÈÁîÒ»·½Òª¿ì¡£ÎÒÊܹÍÓÚ΢Èí£¬Í¬Ê±±àдPHPºÍASP.NET´úÂë¡£ÎÒÔÚ.NET³öÏÖ֮ǰ¾ÍÔÚʹÓÃPHP£¬Á½¸ö¶«Î÷ÎÒ¶¼ºÜϲ»¶¡£
ËùÒÔ£¬ÎÒºÜÄÑ˵³öÄĸö¸üºÃ¡£µ±ÎÒ˵PHPºÃ»°Ê±£¬ÎÒµÄ΢ÈíͬÊÂÃÇ»áдÐÅÀ´ÅúÆÀÎÒ£¬¶øµ±ÎÒ·¢±íÇãÏòÓÚASP.NETµÄÑÔÂÛʱ£¬ÎÒµÄPHPÅóÓÑÃÇ»á˵ÎÒÊÇ΢ÈíµÄÍС£
ÎÒ½øÐÐÕâ¸ö²âÊÔÊÇÒòΪÿ¸öÈ˶¼¶ÔPHPµÄÐÔÄÜÓÐ×Ô¼ºµÄ¿´·¨£¨Windows vs. Linux & 5.2 vs. 5.3£©£¬È´Ã»ÈËÄܸø³öÃ÷È·µÄÊý¾Ý¡£
¸ù¾ÝJoeµÄÃèÊö£¬²âÊÔ»·¾³ÈçÏ£º
ËùÓеIJâÊÔ¶¼ÔÚͬһ̨»úÆ÷ÉÏÔËÐУ¨ÓµÓÐ4GÄÚ´æºÍ60G 7200תӲÅ̵ÄToshiba Tecra M5£©¡£
Ubuntu 9ºÍWindows Server 2008±ê×¼°æ·Ö±ð°²×°ÓÚ¶ÀÁ¢£¨µ«Ïàͬ£©µÄÓ²ÅÌÖС£
LinuxʹÓÃApache2£¬WindowsʹÓÃIIS 7×÷Ϊ¸÷×ÔµÄWeb·þÎñÆ÷¡£
Ë«·½µÄ²Ù×÷ϵͳ¶¼½øÐÐÁËÍêÕûµÄpatch»òÉý¼¶¡£
Ë«·½µÄϵͳºÍÔËÐÐʱ¶¼Ã»ÓнøÐжîÍâµÄÐÔÄÜÔöÇ¿¡£
´ÓʵÑé½á¹ûÉÏ¿´£¬PHPÔÚLinuxºÍWindowsµÄÖ´ÐÐÐÔÄܸ÷ÓÐǧÇ
´¿´âµÄÓï¾äÖ´ÐÐÔÚWindowsÉϱíÏÖ¸üºÃ¡£
º¯Êýµ÷ÓÃÔÚWindowsÉϸü¿ì¡£
¶ÔÏóµÄ´´½¨ºÍ·ÃÎÊ£¬¶ÔÓÚPHP 5.2À´ËµÔÚLinuxÉϸü¿ì£¬µ«ÊǶÔÓÚPHP 5.3À´ËµÔòÊÇWindows¸ü¿ì¡£
Àà¿âµ÷ÓÃÔ
Ïà¹ØÎĵµ£º
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection conn;
SqlCommand cmd1, cmd2;
SqlTransaction tra;
conn = new SqlConnection("server=.;database=test;uid=sa;pwd=123");
conn.Open();
tra = conn.BeginTransaction();//¿ªÊ¼ÊÂÎ ......
¸ÅÊö
URLÖØдÊǽØÈ¡´«ÈëWebÇëÇó²¢×Ô¶¯½«ÇëÇóÖض¨Ïòµ½ÆäËû URL µÄ¹ý³Ì,±ÈÈçä¯ÀÀÆ÷·¢À´ÇëÇóhostname/101.aspx £¬·þÎñÆ÷×Ô¶¯½«Õâ¸öÇëÇóÖж¨ÏòΪhttp://hostname/list.aspx?id=101¡£
urlÖØдµÄÓŵãÔÚÓÚ£º
* Ëõ¶Ìurl£¬Òþ²Øʵ¼Ê·¾¶Ìá¸ß°²È«ÐÔ
* &nbs ......
ASP.NET Òì³£´¦Àí
ÔÚ
Asp.net
¿ª·¢¹ý³ÌÖУ¬ÎÒÃÇ»áÓöµ½ºÜ¶à
Exception
£¬²»´¦ÀíÕâЩ
Exception
µÄ»°»á³öÏÖºÜÄÑ¿´µÄÒ³Ãæ¡£
»¹ÓÐһЩÎÒÃÇδԤÁϵ½µÄ
Exception
£¬µ±·¢Éú
Exception
ʱ£¬ÎÒÃÇÒ²±ØÐë½øÐмǼ¾ßÌåλÖã¬ÒÔ±ãÎÒÃÇÐÞÕý´íÎó¡£
asp.net
Òì³£´¦ÀíµÄλÖôó¸ÅÓÐÒÔÏÂ
3
¸öµØ·½
1.
³ÌÐòµÄ´úÂë¶ÎÖУ¬ÕâÊÇ× ......
ÔÚweb·þÎñÆ÷¶Ë¿ª·¢Öо³£»áÓöµ½¸÷ÖÖ²»Í¬ÐÎʽµÄpath£¬¶øÇÒ¾³£¼Ç²»Çå³þÈçºÎ»ñÈ¡µ½Ä³ÖÖÌض¨¸ñʽ£¬½ñÌì³éÁ˵ãʱ¼ä°Ñ³£ÓõÄpath»ñÈ¡·½·¨Óë¸ñʽ×öÁËÒ»¸ö¼òµ¥µÄ¶ÔÕÕ±í£¬ÒÔ±¸ÈÕºó²éÓá£
Request»ñÈ¡µÄÐÅÏ¢
Request.AppRelativeCurrentExecutionFilePath &nb ......
ASP.NET MVCºÍWebForm¸÷Óи÷µÄÓŵ㣬ÎÒÃÇ¿ÉÄÜÐèҪͬʱʹÓÃASP.NET MVCºÍWebForm¡£±¾ÎĽéÉÜÁËÈçºÎÔÚASP.NET MVCÏîÄ¿ÖÐʹÓÃWebForm¡£
Ê×ÏÈн¨Ò»¸öÃûΪWebFormsµÄÎļþ¼ÐÓÃÓÚ´æ·ÅWebForm£¬²¢Ìí¼ÓÒ»¸öWeb´°ÌåÎļþDemo.aspx×÷ΪÑÝʾ¡£
Demo.aspx¾Í¼òµ¥µÄÊä³öÒ»¾ä»°“It’s a WebForm.”
¹Ø¼ü²½ÖèÔÚÓÚ·ÓÉÉèÖá ......