ApplicationPoolContainsApplication Class1

提供应用程序池与其应用程序之间的关系。

语法

class ApplicationPoolContainsApplication : ObjectContainerAssociation  

方法

此类不包含任何方法。

属性

下表列出了 ApplicationPoolContainsApplication 类的属性。

名称 描述
Container (继承自 ObjectContainerAssociation。)一个代表 IIS 应用程序池的只读 ApplicationPool 对象。 一个键属性。
Element (继承自 ObjectContainerAssociation。)一个代表 IIS 应用程序的只读 Application 对象。 一个键属性。

子类

此类不包含子类。

注解

要实现此关联,请使用配置 API 枚举应用程序池中的应用程序。

示例

以下示例演示如何使用 ApplicationPoolContainsApplication 类检索应用程序池中的所有应用程序。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the application pool.  
Set oAppPool = oWebAdmin.Get("ApplicationPool.Name='DefaultAppPool'")  
  
' Use the ApplicationPoolContainsApplication class to return the set of  
' application instances in the 'DefaultAppPool' application pool.  
Set oApps = oAppPool.Associators_("ApplicationPoolContainsApplication")  
For Each oApp In oApps  
    WScript.Echo oApp.Path   
Next  

请注意以下来自上述代码示例中的语法。

Set oApps = oAppPool.Associators_("ApplicationPoolContainsApplication")

为了简化代码,可以改用以下语法,这样便可以使用关联,而无需记住其确切名称。

Set oApps = oAppPool.Associators_(, "Application")

继承层次结构

ObjectContainerAssociation

ApplicationPoolContainsApplication

要求

类型 描述
客户端 - IIS 7.0(在 Windows Vista 上)
- IIS 7.5(在 Windows 7 上)
- IIS 8.0(在 Windows 8 上)
- IIS 10.0(在 Windows 10 上)
服务器 - IIS 7.0(在 Windows Server 2008 上)
- IIS 7.5(在 Windows Server 2008 R2 上)
- IIS 8.0(在 Windows Server 2012 上)
- IIS 8.5(在 Windows Server 2012 R2 上)
- IIS 10.0(在 Windows Server 2016 上)
产品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 文件 WebAdministration.mof

另请参阅

Application 类
ApplicationPool 类
ObjectContainerAssociation 类