locked
IIS - Default Web Site RRS feed

  • Question

  • Using the following code I am able to get the state of the W3SVC service (IIS) :
    ServiceController cs = new ServiceController("W3SVC");
    string status = cs..Status.TosTring();

    This bit of code give me a bit of info regarding web site:
    DirectoryEntry root = new DirectoryEntry("IIS://localhost/W3SVC");
    foreach (DirectoryEntry e in root.Children)
    {
        if (e.SchemaClassName == "IIsWebServer")
        {
            /* Returns 'Default Web Site' */
            string name = e.Properties["ServerComment"].Value.ToString();
        }
    }

    I am not able to get the status of the 'Default Web Site'. How can I do that through programming? Obvioulsy the status is available via inetmgr but I would like to be able to check it from an application if possible.

    Tuesday, January 20, 2009 2:58 PM

Answers

  •  

    Hello Lars, 

     

    Thank you for your post!  I would suggest posting your question in one of the 

    MSDN > Forums Home > Internet Explorer Development > Internet Explorer Web Development

     located here:  http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads/.

    Have a great day!


    Sudarshan shindode Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by sudarshans1 Wednesday, January 21, 2009 4:46 AM
    • Marked as answer by sudarshans1 Monday, March 23, 2009 10:53 AM
    Wednesday, January 21, 2009 4:46 AM

All replies

  •  

    Hello Lars, 

     

    Thank you for your post!  I would suggest posting your question in one of the 

    MSDN > Forums Home > Internet Explorer Development > Internet Explorer Web Development

     located here:  http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads/.

    Have a great day!


    Sudarshan shindode Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by sudarshans1 Wednesday, January 21, 2009 4:46 AM
    • Marked as answer by sudarshans1 Monday, March 23, 2009 10:53 AM
    Wednesday, January 21, 2009 4:46 AM
  • hi,

    You can also post your question to IIS forum, which is located here: http://forums.iis.net/

    Regards
    Vijay Mullick Tier 2 Application Support Server and Tools Online Engineering Live Services Team
    • Proposed as answer by Vijay Mullick Wednesday, January 21, 2009 5:05 AM
    Wednesday, January 21, 2009 5:05 AM