Пример #1
0
 public override void Start()
 {
     try
     {
         IISWMIHelper.GetIIsWebServer(SiteId).Invoke("Start", null);
     }
     catch (Exception exp)
     {
         throw new Exception(String.Format("Inner error: {0} Outer error: {1}", exp.InnerException.Message, exp.Message));
     }
 }
Пример #2
0
        public static bool DeleteSite(IISIdentifier siteIdentifier)
        {
            String id = "";

            //need to be sure that the site exists or else it can throw an error
            if (IISWMIHelper.TryGetSiteID(siteIdentifier, ref id))
            {
                DirectoryEntry webServer = IISWMIHelper.GetIIsWebServer(id);
                webServer.Invoke("Stop", null);
                webServer.DeleteTree();
                return(true);
            }
            return(false);
        }