Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.netÓòÃû°ó¶¨¡¢É¾³ý·½·¨

#region ÓòÃû°ó¶¨·½·¨
    public static void AddHostHeader(int siteid, string ip, int port, string domain)//Ôö¼ÓÖ÷»úÍ·£¨Õ¾µã±àºÅ.ip.¶Ë¿Ú.ÓòÃû£©
    {
        DirectoryEntry site = new DirectoryEntry("IIS://localhost/W3SVC/" + siteid);
        PropertyValueCollection serverBindings = site.Properties["ServerBindings"];
        string headerStr = string.Format("{0}:{1}:{2}", ip, port, domain);
        if (!serverBindings.Contains(headerStr))
        {
          serverBindings.Add(headerStr);
        }
        site.CommitChanges();
    }
    #endregion
    #region ɾ³ýÖ÷»úÍ·
    public static void DeleteHostHeader(int siteid, string ip, int port, string domain)//ɾ³ýÖ÷»úÍ·£¨Õ¾µã±àºÅ.ip.¶Ë¿Ú.ÓòÃû£©
    {
        DirectoryEntry site = new DirectoryEntry("IIS://localhost/W3SVC/" + siteid);
        PropertyValueCollection serverBindings = site.Properties["ServerBindings"];
        string headerStr = string.Format("{0}:{1}:{2}", ip, port, domain);
        if (serverBindings.Contains(headerStr))
        {
            serverBindings.Remove(headerStr);
        }
        site.CommitChanges();
    }
    #endregion


Ïà¹ØÎĵµ£º

asp.net´°ÌåµÄ´ò¿ªºÍ¹Ø±Õ

asp.net´°ÌåµÄ´ò¿ªºÍ¹Ø±Õ
//´ò¿ªÐµĴ°Ìå
Response.Redirect("WebMain.aspx");   
//µ¯³öÒ»¸öд°Ìå
Response.Write("<script>window.open(\"WebMain.aspx\")</script>")
//µ¯³öÒ»¸öÖ»ÓÐÈ·¶¨°´Å¥µÄÌáʾ¿ò
Response.Write("<script>alert(\"Óû§Ãû»òÃÜÂë´íÎó\");</script>") ......

ASP.NET(C#)ÖÐstringÓëstringBuilderµÄÇø±ð

 
ÔÚÏàͬ×Ö·û´®µÄÐí¶à²Ù×÷ÉÏ£¬Ê¹ÓÃStringBuilderÀà»á±ÈʹÓÃString¶ÔÏó¸üÓÐЧÂÊ¡£
 
 
 µ±Äã¶ÔÒ»¸östring¶ÔÏó¸³ÖµÊ±£¬Õâʱ»áÉú³ÉÒ»¸öÕâ¸ö¶ÔÏóµÄ¸±±¾£¬Èç¹ûÄ㸳ֵ¶à´ÎµÄ»°ÔÚϵͳÖоͻᱣ´æ¶à¸öÕâ¸ö¶ÔÏóµÄ¸±±¾£¬»á¶Ôϵͳ×ÊÔ´Ôì³ÉºÜ´óµÄÀË·Ñ£¬µ«ÊÇStringBuilder²»»á³öÏÈÉÏÊöÇé¿ö
StringÊý¾ÝÀàÐÍ´ú±íµÄ ......

ASP.NET ·þÎñÆ÷¿Ø¼þäÖȾµ½¿Í»§¶ËÖ®ºó¶ÔÓ¦µÄHTML±êÇ©

·þÎñÆ÷¿Ø¼þ        html±ê¼Ç
label----------<span/>
button---------<input type="submit"/>
textbox--------<input type="text"/>
linkbutton-----<a href="javascript:" />
imagebutton----<input type="image"/>
hyperlink------<a />
......

asp.netÖг£ÓõÄÓÅ»¯ÐÔÄܵķ½·¨

1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ±Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ