Compartir a través de


ModulesSection (clase)

Representa la sección módulos de un archivo de configuración.

Sintaxis

class ModulesSection : ConfigurationSectionWithCollection  

Métodos

En la tabla siguiente se enumeran los métodos que expone la clase ModulesSection.

Nombre Descripción
Add (Agregar) (Se hereda de ConfigurationSectionWithCollection).
Borrar (Se hereda de ConfigurationSectionWithCollection).
Get (Se hereda de ConfigurationSectionWithCollection).
GetAllowDefinition (Se hereda de ConfigurationSection).
GetAllowLocation (Se hereda de ConfigurationSection).
Remove (Se hereda de ConfigurationSectionWithCollection).
RevertToParent (Se hereda de ConfigurationSection).
SetAllowDefinition (Se hereda de ConfigurationSection).
SetAllowLocation (Se hereda de ConfigurationSection).

Propiedades

La siguiente tabla muestra las propiedades expuestas por la clase ModulesSection.

Nombre Descripción
Location (Se hereda de ConfigurationSection). Una propiedad clave.
Modules Matriz de valores ModuleAction de lectura y escritura.
Path (Se hereda de ConfigurationSection). Una propiedad clave.
RunAllManagedModulesForAllRequests Valor boolean de lectura y escritura. true si se ejecutan todos los módulos administrados para cada solicitud; de lo contrario, false. El valor predeterminado es false.
SectionInformation (Se hereda de ConfigurationSection).

Subclases

Esta clase no contiene subclases.

Comentarios

Esta clase contiene módulos globales que están habilitados en un nivel determinado en un servidor web y módulos administrados que también realizan el trabajo de solicitud en el mismo nivel.

Ejemplo

En el ejemplo siguiente se muestran los módulos nativos y administrados en la sección <modules> del archivo ApplicationHost.config.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the <modules> section.  
Set oSection = oWebAdmin.Get( _  
    "ModulesSection.Path='MACHINE/WEBROOT/APPHOST/',Location=''")  
  
' Display the native modules.  
WScript.Echo "---------- Native -------------"  
For Each oModule In oSection.Modules  
    If oModule.Type = "" Then  
        WScript.Echo "   " & oModule.Name  
    End If  
Next  
WScript.Echo   
  
' Display the managed modules.  
WScript.Echo "---------- Managed ----------"  
For Each oModule In oSection.Modules  
    If oModule.Type <> "" Then  
        If Len(oModule.Name) < 12 Then  
            WScript.Echo "   " & oModule.Name & _  
                vbTab & vbTab & vbTab & "[" & oModule.Type & "]"  
        ElseIf Len(oModule.Name) < 20 Then  
            WScript.Echo "   " & oModule.Name & _  
                vbTab & vbTab & "[" & oModule.Type & "]"  
        Else   
            WScript.Echo "   " & oModule.Name & _  
                vbTab & "[" & oModule.Type & "]"  
        End If  
    End If  
Next  

Jerarquía de herencia

ConfigurationSection

ConfigurationSectionWithCollection

ModulesSection

Requisitos

Tipo Descripción
Remoto - IIS 7.0 en Windows Vista
- IIS 7.5 en Windows 7
- IIS 8.0 en Windows 8
- IIS 10.0 en Windows 10
Server - IIS 7.0 en Windows Server 2008
- IIS 7.5 en Windows Server 2008 R2
- IIS 8.0 en Windows Server 2012
- IIS 8.5 en Windows Server 2012 R2
- IIS 10.0 en Windows Server 2016
Producto - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
Archivo MOF WebAdministration.mof

Consulte también

ConfigurationSectionWithCollection (clase)
GlobalModuleElement (clase)
GlobalModulesSection (clase)
ModuleAction (clase)