<clear> webRequestModules 的元素(网络设置)

从应用程序中删除所有已注册的 Web 请求模块。

<配置>
   <system.net>
     <webRequestModules>
       <清楚>

Syntax

<clear/>

特性和元素

下列各节描述了特性、子元素和父元素。

特性

没有。

子元素

没有。

父元素

元素 说明
webRequestModules 指定要用于从网络主机请求信息的模块。

注解

clear 元素删除之前在配置文件中或配置层次结构中更高级别定义的所有已注册的 Web 请求模块。

配置文件

此元素可用于应用程序配置文件或计算机配置文件(Machine.config)。

Example

以下示例清除所有 Web 请求模块,然后注册 HTTP 的 Web 请求模块。

<configuration>
  <system.net>
    <webRequestModules>
      <clear/>
      <add prefix="http"
           type="System.Net.HttpRequestCreator, System, Version=2.0.3600.0,
           Culture=neutral, PublicKeyToken=b77a5c561934e089"
      />
    </webRequestModules>
  </system.net>
</configuration>

另请参阅