WebRequest.CreatorInstance 屬性

定義

警告

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

在子代類別中覆寫時,取得衍生自 IWebRequestCreate 類別的 Factory 物件,用來建立執行個體化的 WebRequest 以對指定的 URI 提出要求。When overridden in a descendant class, gets the factory object derived from the IWebRequestCreate class used to create the WebRequest instantiated for making the request to the specified URI.

public:
 virtual property System::Net::IWebRequestCreate ^ CreatorInstance { System::Net::IWebRequestCreate ^ get(); };
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)]
public virtual System.Net.IWebRequestCreate CreatorInstance { get; }
member this.CreatorInstance : System.Net.IWebRequestCreate
[<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

屬性值

IWebRequestCreate

Create(Uri) 方法傳回的衍生 WebRequest 類型。The derived WebRequest type returned by the Create(Uri) method.

屬性

備註

這個屬性可讓應用程式判斷 IWebRequestCreate 用來建立要求的衍生 factory 物件。This property allows an application to determine which IWebRequestCreate derived factory object was used to create the request. 這個物件可以是 WebRequestCreator. BrowserHttpWebRequestCreator. ClientHttp,但是也可能是衍生自的自訂 IWebRequestCreate 實例。This object may be System.Net.Browser.WebRequestCreator.BrowserHttp or System.Net.Browser.WebRequestCreator.ClientHttp, but it may also be a custom instance derived from IWebRequestCreate. 這可讓應用程式判斷瀏覽器裝載 SilverlightSilverlightSilverlightSilverlight 用戶端或某些自訂物件是否處理實例的 HTTP 要求和回應 WebRequestThis allows an application to determine whether the browser hosting SilverlightSilverlight, the SilverlightSilverlight client, or some custom object handles HTTP requests and responses for the WebRequest instance. RegisterPrefix方法可讓應用程式設定 WebRequest 在對特定 URI 提出要求時,將具現化的衍生型別。The RegisterPrefix method allows an application to configure which derived WebRequest type will be instantiated when making a request to a specific URI. WebRequest 建立者通常會註冊來處理特定的通訊協定(例如 HTTP 或 HTTPS),但可以註冊來處理對伺服器上特定伺服器或路徑的要求。WebRequest creators are typically registered to handle a specific protocol, such HTTP or HTTPS, but can be registered to handle a request to a specific server or path on a server. 當有一個以上 WebRequest 的衍生類型可以處理相同通訊協定的要求時,這會很有用。This is useful when more than one derived WebRequest type can process requests for the same protocol. Microsoft Silverlight 3Microsoft Silverlight 3和更新版本執行時間支援多個 HTTP 處理常式,每個都有不同的功能。The Microsoft Silverlight 3Microsoft Silverlight 3 and later runtime supports multiple HTTP handlers each having different capabilities. 例如,使用具象狀態傳輸 (REST) 的 web 服務,可能需要 WebRequestCreator ClientHttp 處理常式,而 SOAP web 服務可能會使用預設的 WebRequestCreator. BrowserHttp 處理常式。For example, a web service that uses Representational State Transfer (REST) might require the System.Net.Browser.WebRequestCreator.ClientHttp handler while a SOAP web service might be able to use the default System.Net.Browser.WebRequestCreator.BrowserHttp handler.

適用於