Поделиться через


Класс GlobalModulesSection

Предоставляет параметры конфигурации для глобальных модулей IIS.

Синтаксис

class GlobalModulesSection : ConfigurationSectionWithCollection  

Методы

В следующей таблице перечислены методы, предоставляемые классом GlobalModulesSection .

Имя Описание
Добавление (Наследуется от ConfigurationSectionWithCollection.)
Очистить (Является наследником ConfigurationSectionWithCollection)
Get (Является наследником ConfigurationSectionWithCollection)
GetAllowDefinition (Наследуется от ConfigurationSection.)
GetAllowLocation (Является наследником ConfigurationSection)
Удалить (Является наследником ConfigurationSectionWithCollection)
RevertToParent (Является наследником ConfigurationSection)
SetAllowDefinition (Является наследником ConfigurationSection)
SetAllowLocation (Является наследником ConfigurationSection)

Свойства

В следующей таблице перечислены свойства, предоставляемые классом GlobalModulesSection .

Имя Описание
GlobalModules Массив объектов GlobalModuleElement .
Location (Наследуется от ConfigurationSection.) Свойство ключа.
Path (Наследуется от ConfigurationSection.) Свойство ключа.
SectionInformation (Является наследником ConfigurationSection)

используются подклассы ;

Этот класс не содержит подклассов.

Комментарии

Раздел <globalModules> в файле ApplicationHost.config указывает собственные модули на уровне сервера. Эти модули можно включить, добавив их имена в <modules> раздел на требуемом уровне конфигурации в ApplicationHost.config или в Web.config файле. В WMI это можно сделать с помощью Add метода класса ModulesSection .

Пример

В следующем примере перечислены модули в <globalModules> разделе .

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the ApplicationHost.config <globalModules> section.  
Set oSection = oWebAdmin.Get( _  
    "GlobalModulesSection.Path=" & _  
    "'MACHINE/WEBROOT/APPHOST/',Location=''")  
  
' Display the path.  
WScript.Echo  
WScript.Echo "Path: " & oSection.Path  
WScript.Echo  
  
' Display the global modules.  
WScript.Echo "Global Modules"  
WScript.Echo "--------------"  
For Each oGMElement In oSection.GlobalModules  
     WScript.Echo "Module: " & oGMElement.Name  
     WScript.Echo "Image: " & oGMElement.Image  
     WScript.Echo "PreCondition: " & oGMElement.PreCondition  
     WScript.Echo  
Next  

Иерархия наследования

ConfigurationSection

ConfigurationSectionWithCollection

GlobalModulesSection

Требования

Тип Описание
клиент — 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

См. также:

Класс ConfigurationSection
Класс ConfigurationSectionWithCollection
Класс GlobalModuleElement
Класс ModulesSection