WebRequest.CreatorInstance WebRequest.CreatorInstance WebRequest.CreatorInstance WebRequest.CreatorInstance Property

定义

警告

此 API 现已过时。

当在子类中重写时,获取从 IWebRequestCreate 类派生的工厂对象,该类用于创建为生成对指定 URI 的请求而实例化的 WebRequestWhen 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(); };
[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
Public Overridable ReadOnly Property CreatorInstance As IWebRequestCreate

属性值

WebRequest 方法返回的派生 Create(Uri) 类型。The derived WebRequest type returned by the Create(Uri) method.

注解

此属性允许应用程序确定哪些IWebRequestCreate派生工厂对象用于创建请求。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. 这样,应用程序便可以确定浏览器承载SilverlightSilverlight SilverlightSilverlight 、客户端或某个自定义对象是否处理WebRequest实例的 HTTP 请求和响应。This 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.

适用于