WebRequest.CreatorInstance 屬性

定義

警告

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

在子代類別中覆寫時,取得衍生自 IWebRequestCreate 類別的 Factory 物件,用來建立執行個體化的 WebRequest 以對指定的 URI 提出要求。

public:
 virtual property System::Net::IWebRequestCreate ^ CreatorInstance { System::Net::IWebRequestCreate ^ get(); };
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public virtual System.Net.IWebRequestCreate CreatorInstance { get; }
[<System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)>]
member this.CreatorInstance : System.Net.IWebRequestCreate
Public Overridable ReadOnly Property CreatorInstance As IWebRequestCreate

屬性值

Create(Uri) 方法傳回的衍生 WebRequest 類型。

屬性

備註

這個屬性可讓應用程式判斷用來 IWebRequestCreate 建立要求的衍生處理站物件。 此物件可能是 System.Net.Browser.WebRequestCreator.BrowserHttpSystem.Net.Browser.WebRequestCreator.ClientHttp,但它也可能是衍生自 IWebRequestCreate 的自訂實例。 這可讓應用程式判斷裝載 Silverlight、Silverlight 用戶端的瀏覽器,還是某些自訂物件會處理實例的 WebRequest HTTP 要求和回應。 方法 RegisterPrefix 可讓應用程式設定對特定 URI 提出要求時,將具現化哪些衍生 WebRequest 類型。 WebRequest 建立者通常會註冊來處理特定通訊協定,例如 HTTP 或 HTTPS,但可以註冊來處理對伺服器上特定伺服器或路徑的要求。 當多個衍生 WebRequest 型別可以處理相同通訊協定的要求時,這非常有用。 Microsoft Silverlight 3 和更新版本的執行時間支援多個 HTTP 處理常式,每個處理常式都有不同的功能。 例如,使用表示狀態傳輸的 Web 服務 (REST) 可能需要 System.Net.Browser.WebRequestCreator.ClientHttp 處理常式,而 SOAP Web 服務可能可以使用預設 的 System.Net.Browser.WebRequestCreator.BrowserHttp 處理常式。

適用於