Beispiel #1
0
        private string GetSiteName()
        {
            var comment = string.Empty;

            if (!string.IsNullOrEmpty(Site.WebRootPath))
            {
                if (!Directory.Exists(Site.WebRootPath))
                {
                    comment = "Web Root Path not found";
                }
                else if (!Directory.Exists(Path.Combine(Site.WebRootPath, "bin")))
                {
                    comment = "/bin folder not found";
                }
                else if (!Directory.Exists(Path.Combine(Site.WebRootPath, "sitecore")))
                {
                    comment = "/sitecore folder not found";
                }
                else
                {
                    comment = WebAdministration.GetWebSiteState(Site);
                }
            }

            var result = Site.Name;

            if (!string.IsNullOrEmpty(comment))
            {
                result += string.Format(" ({0})", comment);
            }

            return(result);
        }