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