ÔÚ²»Í¬°æ±¾µÄ IIS ÉÏʹÓà ASP.NET MVC
ÔÚ²»Í¬°æ±¾µÄ IIS ÉÏʹÓà ASP.NET MVC
ASP.NET MVC Framework ÒÀÀµÓÚ URL ·ÓÉ¡£ÎªÁËÀûÓà URL ·ÓÉ£¬¿ÉÄܲ»µÃ²»ÔÚ Web ·þÎñÆ÷ÉÏÖ´ÐжîÍâµÄÅäÖò½Öè¡£ÕâЩ²½ÖèÈ¡¾öÓÚ Internet Information Services (IIS) µÄ°æ±¾ºÍÓ¦ÓóÌÐòµÄÇëÇó´¦Àíģʽ¡£
IIS µÄ×îа汾ÊÇ°æ±¾ 7.0¡£IIS µÄ´Ë°æ±¾°üÀ¨ÔÚ Windows Server 2008 ÖС£»¹¿ÉÒÔÔÚ³ý Home Basic ÒÔÍâµÄÈκΠVista ²Ù×÷ϵͳÉÏ°²×° IIS 7.0£¨Çë²Î¼û http://technet.microsoft.com/en-us/library/cc732624.aspx£©¡£
IIS 7.0 Ö§³ÖÁ½ÖÖģʽµÄ´¦ÀíÇëÇ󡣿ÉÒÔʹÓü¯³Éģʽ»ò¾µäģʽ¡£ÒÔ¼¯³ÉģʽʹÓà IIS 7.0 ʱ²»ÐèÒªÖ´ÐÐÈκÎÌØÊâÅäÖò½Öè¡£µ«ÊÇÒÔ¾µäģʽʹÓà IIS 7.0 ʱÐèÒªÖ´ÐжîÍâµÄÅäÖá£
Microsoft Windows Server 2003 °üº¬ IIS 6.0¡£ÔÚʹÓà Windows Server 2003 ²Ù×÷ϵͳʱ²»Äܽ« IIS 6.0 Éý¼¶Îª IIS 7.0¡£Ê¹Óà IIS 6.0 ʱ±ØÐëÖ´ÐÐÆäËûÅäÖò½Öè¡£
Microsoft Windows XP Professional °üº¬ IIS 5.1¡£Ê¹Óà IIS 5.1 ʱ±ØÐëÖ´ÐÐÆäËûÅäÖò½Öè¡£
×îºó£¬Microsoft Windows 2000 ºÍ Microsoft Windows 2000 Professional °üº¬ IIS 5.0¡£Ê¹Óà IIS 5.0 ʱ±ØÐëÖ´ÐÐÆäËûÅäÖò½Öè¡£
ÒÔÏÂÊDz»Í¬ IIS °æ±¾µÄ×ܽ᣺
IIS 7.0£¨¼¯³Éģʽ£©– ʹÓà URL ·Óɲ»ÐèÒªÌØÊâÅäÖá£
IIS 7.0£¨¾µäģʽ£©– ÐèÒªÖ´ÐÐÌØÊâÅäÖòÅÄÜʹÓà URL ·ÓÉ¡£
IIS 6.0 »ò¸üµÍ°æ±¾– ÐèÒªÖ´ÐÐÌØÊâÅäÖòÅÄÜʹÓà URL ·ÓÉ¡£
¼¯³ÉģʽºÍ¾µäģʽ
IIS 7.0 ¿ÉÒÔʹÓÃÁ½ÖÖÇëÇó´¦Àíģʽ´¦ÀíÇëÇ󣺼¯³ÉģʽºÍ¾µäģʽ¡£¼¯³Éģʽ¿ÉÌṩ¸üºÃµÄÐÔÄܺ͸ü¶àµÄ¹¦ÄÜ¡£¾µäģʽÓÃÓÚÏòÔçÆÚµÄ IIS °æ±¾ÌṩÏòºó¼æÈÝÐÔ¡£
ÇëÇó´¦ÀíģʽÓÉÓ¦ÓóÌÐò³Ø¾ö¶¨¡£Í¨¹ýÈ·¶¨ÓëÓ¦ÓóÌÐò¹ØÁªµÄ³Ø£¬¿ÉÒÔÈ·¶¨Ìض¨µÄ Web Ó¦ÓóÌÐòʹÓúÎÖÖ´¦Àíģʽ¡£Ö´ÐÐÒÔϲ½Ö裺
Æô¶¯ Internet Information Services Manager¡£
ÔÚ Connections ´°¿ÚÖÐÑ¡ÔñÒ»¸öÓ¦ÓóÌÐò¡£
ÔÚ Actions ´°¿ÚÖУ¬µ¥»÷ Basic SettingsÁ´½ÓÒÔ´ò¿ª Edit Application ¶Ô»°¿ò£¬Èçͼ 1 Ëùʾ¡£
×¢ÒâÑ¡ÔñµÄ Application Pool¡£
ĬÈÏÇé¿öÏ£¬IIS ÅäÖÃΪ֧³ÖÁ½ÖÖÓ¦ÓóÌÐò³Ø£ºDefaultAppPoolºÍ Classic .NET AppPool¡£Èç¹ûÑ¡ÔñDefaultAppPool£¬ÔòÓ¦ÓóÌÐòÔÚ¼¯³ÉÇëÇó´¦ÀíģʽÏÂÔËÐС£Èç¹ûÑ¡ÔñClassic .NET AppPool£¬ÔòÓ¦ÓóÌÐòÔÚ¾µäÇëÇó´¦ÀíģʽÏÂÔËÐС£
ͼ 1£ºÌ½²âÇëÇó´¦Àíģʽ£¨µ¥»÷²é¿´´óͼ£©
Çë×¢Ò⣬¿ÉÒÔÔÚ Edit Application ¶Ô»°¿òÖÐÐÞ¸ÄÇëÇó´¦Àíģʽ¡£µ¥»÷ Select °´Å¥²¢¸ü¸ÄÓëÓ¦ÓóÌÐò¹ØÁªµ
Ïà¹ØÎĵµ£º
C# ASP.NETÀï@µÄÃîÓÃ
ASP.NET C# string ×Ö·û´®µÄÇ°Ãæ¿ÉÒÔ¼Ó @ ¿ÉÒÔ½«×ªÒå×Ö·û£¨\£©µ±×÷ÆÕͨ×Ö·û¶Ô´ý¡£
±ÈÈ磺string str = @"C:\Windows";
Èç¹ûÎÒÃDz»Óà @ µÄ»°£¬Ó¦¸ÃÊÇ£ºstring str = "C:\\Windows";
@ ×Ö·û´®ÖУ¬ÎÒÃÇÓÃÁ½¸öÁ¬ÐøÓ¢ÎÄË«ÒýºÅ±íʾһ¸öÓ¢ÎÄË«ÒýºÅ£¬ÈçÏÂ×Ö·û´®µÄʵ¼ÊÄÚÈÝΪ£º="=£¬×Ö·û´®³¤¶ÈΪ 3 ......
¶ÔWebÓ¦ÓóÌÐòÀ´Ëµ£¬·¢Éú²»¿ÉÔ¤ÖªµÄ´íÎóºÍÒì³£ÔÚËùÄÑÃ⣬ÎÒÃDZØÐëΪWeb³ÌÐòÌṩ´íÎó´¦Àí»úÖÆ¡£µ±´íÎó·¢Éúʱ£¬ÎÒÃDZØÐë×öºÃÁ½¼þÊÂÇ飺һÊǽ«´íÎóÐÅÏ¢¼Ç¼ÈÕÖ¾£¬·¢Óʼþ֪ͨÍøվά»¤ÈËÔ±£¬·½±ã¼¼ÊõÈËÔ±¶Ô´íÎó½øÐиú×Ù´¦Àí£»
¶þÊÇÒÔÓѺõķ½Ê½Ìáʾ×îÖÕÓû§Ò³Ãæ·¢ÉúÁË´íÎ󣬶ø²»Äܽ«Î´´¦ÀíµÄ´íÎóÐÅÏ¢ÏÔʾ¸øÓû§¡£
&nbs ......
web.config
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="mymail<you@163.com>">
......
¸ø³öÈçÏÂÀý×Ó ÎÒÖ»ÖªµÀÕâÑù×ö¿ÉÒÔµ÷ÓÃÉÏÒ»¸öÒ³Ãæ µÄÖµ»òÕß·½·¨ µ«ÊÇÎÒ²»ÖªµÀÔÀíºÍËüµÄÓÅÂÔ
Çë¸ßÊÖ ¼ÓÒÔÖ¸µã ´ó¼Ò¹²Í¬Ñ§Ï° лл£¡
1.Default.aspx Ò³Ãæ
protected void but1_Click(object sender, EventArgs e)
{
Server.Transfer("Default2.aspx");
......
¹Ø±Õ´°Ìå
1.
this.btnClose.Attributes.Add("onclick", "window.close();return false;");
2.¹Ø±Õ±¾´°Ìå¼äÌøתµ½ÁíÒ»¸öÒ³Ãæ
this.HyperLink1.NavigateUrl = "javascript:onclick=window.opener.location.assign
......