共用方式為


<remove> Element for webRequestModules (Network Settings)

移除應用程式中的自訂網頁請求模組。

<組態>
   <system.net>
     <webRequestModules>
       <除>

語法

<remove
  prefix="URI prefix"
/>

屬性和項目

下列章節說明屬性、子元素和父元素。

Attributes

Attribute 說明
prefix 此 Web 請求模組處理請求的 URI 前綴。

子元素

沒有。

父項目

元素 說明
webRequestModules 指定用於向網路主機請求資訊的模組。

備註

remove 元素會移除指定 URI 前綴的註冊 Web 請求模組。

屬性的值 prefix 應為有效 URI 的首字母,例如 “http, 或 ”http://www.contoso.com“。

組態檔

此元素可用於應用程式設定檔或機器設定檔(Machine.config)。

Example

以下範例移除現有的 HTTP 網路請求模組,並註冊一個新的自訂 HTTP 請求模組。www.contoso.com

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

另請參閱