IsapiCgiRestrictionSection 类

为在 ISAPI 模式下运行的 Web 服务器配置 ISAPI 和通用网关接口 (CGI) 限制。

语法

class IsapiCgiRestrictionSection : ConfigurationSectionWithCollection  

方法

下表列出了 IsapiCgiRestrictionSection 类公开的方法。

名称 说明
添加 (继承自 ConfigurationSectionWithCollection。)
清除 (从 ConfigurationSectionWithCollection 继承。)
Get (从 ConfigurationSectionWithCollection 继承。)
GetAllowDefinition (继承自 ConfigurationSection。)
GetAllowLocation (从 ConfigurationSection 继承。)
删除 (从 ConfigurationSectionWithCollection 继承。)
RevertToParent (从 ConfigurationSection 继承。)
SetAllowDefinition (从 ConfigurationSection 继承。)
SetAllowLocation (从 ConfigurationSection 继承。)

属性

下表列出了 IsapiCgiRestrictionSection 类公开的属性。

名称 描述
IsapiCgiRestriction IsapiCgiRestrictionElement 值的数组,包含 ISAPI 或 CGI 限制。
Location (继承自 ConfigurationSection。)一个键属性。
NotListedCgisAllowed 一个读/写 boolean 值。 如果不允许列出 CGI 限制,则为 true;否则为 false。 默认为 false
NotListedIsapisAllowed 一个读/写 boolean 值。 如果不允许列出 ISAPI 限制,则为 true;否则为 false。 默认为 false
Path (继承自 ConfigurationSection。)一个键属性。
SectionInformation (从 ConfigurationSection 继承。)

子类

此类不包含子类。

注解

ISAPI 和 CGI 限制请求处理程序,允许在服务器上执行动态内容。 这些限制是 CGI 文件 (.exe) 或 ISAPI 扩展 (.dll)。 默认情况下包括 Asp.dll 和 Aspnet_isapi.dll 文件。 如果 IIS 配置允许,可以添加自定义 ISAPI 或 CGI 限制。

注意

如果在 ISAPI 模式下运行 IIS 7,则可以在 Web 服务器上使用 ISAPI 或 CGI 限制。 如果在集成模式下运行 IIS 7,此功能不可用。

示例

下面的示例显示 NotListedCgisAllowedNotListedIsapisAllowedPath 属性的值,并列出 IsapiCgiRestriction 数组属性的内容。

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")  
  
' Get the default Web site.  
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")  
  
' Get the ISAPI-CGI restriction section.  
oSite.GetSection "IsapiCgiRestrictionSection", oSection  
  
' Display the non-array IsapiCgiRestrictionSection properties.  
WScript.Echo "ISAPI CGI Restriction Section"  
WScript.Echo "-----------------------------"  
WScript.Echo "Path: " & oSection.Path  
WScript.Echo "NotListedCgisAllowed: " & _  
    oSection.NotListedCgisAllowed  
WScript.Echo "NotListedIsapisAllowed: " & _  
    oSection.NotListedIsapisAllowed  
WScript.Echo   
  
' Display the contents of the IsapiCgiRestriction array property.  
WScript.Echo vbTab & "ISAPI CGI Restriction Elements"  
WScript.Echo vbtab & "------------------------------"  
For Each oIsapiCgiRestrictionElement In oSection.IsapiCgiRestriction  
    WScript.Echo  vbtab & "GroupID: " & _  
        oIsapiCgiRestrictionElement.GroupID  
    WScript.Echo  vbtab & "Description: " & _  
        oIsapiCgiRestrictionElement.Description  
    WScript.Echo  vbtab & "Path: " & _  
        oIsapiCgiRestrictionElement.Path  
    WScript.Echo  vbtab & "Allowed: " & _  
        oIsapiCgiRestrictionElement.Allowed  
    WScript.Echo  
Next  
  

继承层次结构

ConfigurationSection

ConfigurationSectionWithCollection

IsapiCgiRestrictionSection

要求

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

另请参阅

ConfigurationSectionWithCollection 类
IsapiCgiRestrictionElement 类