コード例 #1
0
        public WebSiteData GetInfo()
        {
            InternetInformationServer iis = new InternetInformationServer();
            WebSite webSite = iis.GetWebSite(_siteName);

            if (webSite == null)
                return null;

            var siteData = new WebSiteData();
            var dirSettings = webSite.DirectorySettings;
            siteData.AppPoolName = (string)dirSettings.GetInstance(dirSettings.Path).GetPropertyValue("AppPoolId");
            siteData.PhysicalPath = (string)dirSettings.GetInstance(dirSettings.Path).GetPropertyValue("Path");
            siteData.SiteStarted = webSite.CurrentState == ServerState.Started;
            siteData.AppPoolStarted = true;

            return siteData;
        }
コード例 #2
0
        public WebSiteData GetInfo()
        {
            InternetInformationServer iis = new InternetInformationServer();
            WebSite webSite = iis.GetWebSite(_siteName);

            if (webSite == null)
            {
                return(null);
            }

            var siteData    = new WebSiteData();
            var dirSettings = webSite.DirectorySettings;

            siteData.AppPoolName    = (string)dirSettings.GetInstance(dirSettings.Path).GetPropertyValue("AppPoolId");
            siteData.PhysicalPath   = (string)dirSettings.GetInstance(dirSettings.Path).GetPropertyValue("Path");
            siteData.SiteStarted    = webSite.CurrentState == ServerState.Started;
            siteData.AppPoolStarted = true;

            return(siteData);
        }