本文整理匯總了C#中WebsitePanel.Providers.Web.WebServer.DeleteVirtualDirectory方法的典型用法代碼示例。如果您正苦於以下問題:C# WebServer.DeleteVirtualDirectory方法的具體用法?C# WebServer.DeleteVirtualDirectory怎麽用?C# WebServer.DeleteVirtualDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebsitePanel.Providers.Web.WebServer
的用法示例。
在下文中一共展示了WebServer.DeleteVirtualDirectory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DeleteVirtualDirectory
public static int DeleteVirtualDirectory(int siteItemId, string vdirName)
{
// check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// load site item
WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
if (siteItem == null)
return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND;
// place log record
// place log record
TaskManager.StartTask("WEB_SITE", "DELETE_VDIR", vdirName);
TaskManager.ItemId = siteItemId;
TaskManager.WriteParameter("Web site", siteItem.Name);
try
{
// create directory
WebServer web = new WebServer();
ServiceProviderProxy.Init(web, siteItem.ServiceId);
web.DeleteVirtualDirectory(siteItem.SiteId, vdirName);
return 0;
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}