我試圖在db中保留應用程序池CPU使用大小。有很多應用程序池,我不知道應用程序池的大小。我必須做這樣的事情:用於存儲的IIS應用程序池標識
應用程序池ID - cpu使用率大小分貝
,但我不知道如何讓應用程序池標識。我已經這樣做了;
var appPoolPath = @"IIS://" + Environment.MachineName + "/W3SVC/AppPools";
using (var w3svc = new DirectoryEntry(appPoolPath))
{
foreach (DirectoryEntry item in w3svc.Children)
{
// i can get name like item.Name
//but
// i need current app pool id in loop
}
}
但我看每個應用程序池都有相同的Guid。它不一定是不一樣的嗎?
請了解Microsoft.Web.Administration API。你使用的是過時的。 –
我知道這一點,但即時通訊工作我看不到任何標識爲appPool ..再次感謝您的幫助:) @LexLi – girlwiththebluehair