本文整理汇总了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();
}
}
示例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();
}
}