我正在使用 Microsoft.Web.Administration.dll 使用以下代码检查我的网站的状态。它适用于 IIS,但在 IIS Expresss 中使用时,“State”属性会抛出“NotImplementedException”。
ServerManager manager = new ServerManager()
foreach (Site site in manager.Sites){
If (site.State == ObjectState.Started)
{
.....
}
}
有没有人遇到过这个问题?