public IEnumerable<WebSite> GetWebSites()
		{
			using (var iisManager = new ServerManager())
			{
				foreach (var webSite in iisManager.Sites)
				{
					var webSiteModel = new WebSite();

					webSiteModel.Id = webSite.Id.ToString(CultureInfo.InvariantCulture);
					webSiteModel.Name = webSite.Name;
					webSiteModel.PhysicalPath = webSite.PhysicalPath();
					webSiteModel.DefaultAppPool = webSite.ApplicationDefaults.ApplicationPoolName;

					yield return webSiteModel;
				}
			}
		}
Exemple #2
0
		public IEnumerable<WebSite> GetWebSites()
		{
			using (var iisRoot = new DirectoryEntry(IISEntry))
			{
				foreach (DirectoryEntry webSiteEntry in iisRoot.Children)
				{
					if (webSiteEntry.SchemaClassName.ToLower(CultureInfo.InvariantCulture) == IISWebServer)
					{
						var webSiteModel = new WebSite();

						webSiteModel.Id = webSiteEntry.Name;
						webSiteModel.Name = webSiteEntry.Properties[ServerComment].Value.ToString();
						webSiteModel.PhysicalPath = webSiteEntry.PhysicalPath();
						webSiteModel.DefaultAppPool = (string)webSiteEntry.Properties["AppPoolId"].Value;

						yield return webSiteModel;
					}
				}
			}
		}
Exemple #3
0
        public IEnumerable <WebSite> GetWebSites()
        {
            using (var iisRoot = new DirectoryEntry(IISEntry))
            {
                foreach (DirectoryEntry webSiteEntry in iisRoot.Children)
                {
                    if (webSiteEntry.SchemaClassName.ToLower(CultureInfo.InvariantCulture) == IISWebServer)
                    {
                        var webSiteModel = new WebSite();

                        webSiteModel.Id             = webSiteEntry.Name;
                        webSiteModel.Name           = webSiteEntry.Properties[ServerComment].Value.ToString();
                        webSiteModel.PhysicalPath   = webSiteEntry.PhysicalPath();
                        webSiteModel.DefaultAppPool = (string)webSiteEntry.Properties["AppPoolId"].Value;

                        yield return(webSiteModel);
                    }
                }
            }
        }
Exemple #4
0
        public IEnumerable <WebSite> GetWebSites()
        {
            using (var iisManager = new ServerManager())
            {
                foreach (var webSite in iisManager.Sites)
                {
                    var webSiteModel = new WebSite();

                    webSiteModel.Id             = webSite.Id.ToString(CultureInfo.InvariantCulture);
                    webSiteModel.Name           = webSite.Name;
                    webSiteModel.PhysicalPath   = webSite.PhysicalPath();
                    webSiteModel.DefaultAppPool = webSite.ApplicationDefaults.ApplicationPoolName;

                    var firstBinding = webSite.Bindings.FirstOrDefault();

                    if (firstBinding != null)
                    {
                        webSiteModel.Port = firstBinding.EndPoint.Port.ToString(CultureInfo.InvariantCulture);
                    }

                    yield return(webSiteModel);
                }
            }
        }
Exemple #5
0
        private static void StoreSiteDataInAvailableSitesTable(Session session, WebSite webSite)
        {
			var availableSitesTable = session.Database.OpenView(AvailableSites);

            var newWebSiteRecord = new Record(4);
            newWebSiteRecord[1] = webSite.Id;
            newWebSiteRecord[2] = webSite.Name;
            newWebSiteRecord[3] = webSite.PhysicalPath;
			newWebSiteRecord[4] = webSite.DefaultAppPool;

			availableSitesTable.Modify(ViewModifyMode.InsertTemporary, newWebSiteRecord);
        }
Exemple #6
0
		private static void StoreSiteDataInComboBoxTable(Session session, WebSite webSite, int order)
        {
			var comboBoxTable = session.Database.OpenView(GetComboContent);

            var newComboRecord = new Record(5);
            newComboRecord[1] = WebSiteProperty;
            newComboRecord[2] = order;
			newComboRecord[3] = webSite.Id;
			newComboRecord[4] = webSite.Name;
			newComboRecord[5] = webSite.PhysicalPath;

			comboBoxTable.Modify(ViewModifyMode.InsertTemporary, newComboRecord);
        }