当前位置: 首页>>代码示例>>C#>>正文


C# WebServer.IsFrontPageInstalled方法代码示例

本文整理汇总了C#中WebsitePanel.Providers.Web.WebServer.IsFrontPageInstalled方法的典型用法代码示例。如果您正苦于以下问题:C# WebServer.IsFrontPageInstalled方法的具体用法?C# WebServer.IsFrontPageInstalled怎么用?C# WebServer.IsFrontPageInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebsitePanel.Providers.Web.WebServer的用法示例。


在下文中一共展示了WebServer.IsFrontPageInstalled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteWebSite

        public static int DeleteWebSite(int siteItemId)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // load web site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            // place log record
            TaskManager.StartTask("WEB_SITE", "DELETE", siteItem.Name);
            TaskManager.ItemId = siteItemId;

            // delete web site
            try
            {
				// remove all web site pointers
				List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
				foreach (DomainInfo pointer in pointers)
					DeleteWebSitePointer(siteItemId, pointer.DomainId, false);

				// remove web site main pointer
				DomainInfo domain = ServerController.GetDomain(siteItem.Name);
				if(domain != null)
					DeleteWebSitePointer(siteItemId, domain.DomainId, false);

				// delete web site
                WebServer web = new WebServer();
                ServiceProviderProxy.Init(web, siteItem.ServiceId);

				#region Fix for bug #710
				//
				if (web.IsFrontPageSystemInstalled() && web.IsFrontPageInstalled(siteItem.SiteId))
				{
					web.UninstallFrontPage(siteItem.SiteId, siteItem.FrontPageAccount);
				} 
				#endregion

				//
                web.DeleteSite(siteItem.SiteId);

                // delete service item
                PackageController.DeletePackageItem(siteItemId);

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
开发者ID:jordan49,项目名称:websitepanel,代码行数:57,代码来源:WebServerController.cs

示例2: DeleteWebSite

        public static int DeleteWebSite(int siteItemId, bool deleteWebsiteDirectory)
        {
            // check account
            int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
            if (accountCheck < 0) return accountCheck;

            // load web site item
            WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
            if (siteItem == null)
                return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;

            // place log record
            TaskManager.StartTask("WEB_SITE", "DELETE", siteItem.Name, siteItemId);

            // delete web site
            try
            {
				//cleanup certificates
                //cleanup certificates
                List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
                foreach (SSLCertificate c in certificates)
                {
                    DeleteCertificate(siteItemId, c);
                }
                
                // remove all web site pointers
				List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
				foreach (DomainInfo pointer in pointers)
					DeleteWebSitePointer(siteItemId, pointer.DomainId, false, true, true);

				// remove web site main pointer
				DomainInfo domain = ServerController.GetDomain(siteItem.Name);
				if(domain != null)
					DeleteWebSitePointer(siteItemId, domain.DomainId, false, true, true);

                List<WebSite> sites = WebServerController.GetWebSites(domain.PackageId, false);
                bool oneSiteOnly = (sites.Count == 1);

                if (oneSiteOnly)
                {
                    // load site item
                    IPAddressInfo ip = ServerController.GetIPAddress(sites[0].SiteIPAddressId);

                    string serviceIp = (ip != null) ? ip.ExternalIP : null;

                    if (string.IsNullOrEmpty(serviceIp))
                    {
                        StringDictionary settings = ServerController.GetServiceSettings(sites[0].ServiceId);
                        if (settings["PublicSharedIP"] != null)
                            serviceIp = settings["PublicSharedIP"].ToString();
                    }

                    ServerController.RemoveServiceDNSRecords(domain.PackageId, ResourceGroups.Web, domain, serviceIp, true);
                }




				// delete web site
                WebServer web = new WebServer();
                ServiceProviderProxy.Init(web, siteItem.ServiceId);

				//
				if (web.IsFrontPageSystemInstalled() && web.IsFrontPageInstalled(siteItem.SiteId))
				{
					web.UninstallFrontPage(siteItem.SiteId, siteItem.FrontPageAccount);
				} 

				//
                web.DeleteSite(siteItem.SiteId);

                // Delete WebManagementAccess Account
                WebServerController.RevokeWebManagementAccess(siteItemId);

                if (deleteWebsiteDirectory)
                {
                    // Delete website directory from file server
                    // This will remove the hard quota as well
                    FilesController.DeleteDirectoryRecursive(siteItem.PackageId, new DirectoryInfo(siteItem.DataPath).Parent.FullName);

                }
                // delete service item
                PackageController.DeletePackageItem(siteItemId);

                return 0;
            }
            catch (Exception ex)
            {
                throw TaskManager.WriteError(ex);
            }
            finally
            {
                TaskManager.CompleteTask();
            }
        }
开发者ID:lwhitelock,项目名称:Websitepanel,代码行数:95,代码来源:WebServerController.cs


注:本文中的WebsitePanel.Providers.Web.WebServer.IsFrontPageInstalled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。