PackWebRequest PackWebRequest PackWebRequest PackWebRequest Class

定义

向整个 PackagePart 或包中的 PackagePart 发出请求,由 Pack URI 标识。Makes a request to an entire PackagePart or to a PackagePart in a package, identified by a pack URI.

public ref class PackWebRequest sealed : System::Net::WebRequest
public sealed class PackWebRequest : System.Net.WebRequest
type PackWebRequest = class
    inherit WebRequest
Public NotInheritable Class PackWebRequest
Inherits WebRequest
继承

注解

System.IO.PackagingAPIAPIs使用定义的 pack uri 语法来引用包中包含的部件。System.IO.Packaging APIAPIs use a defined pack uri syntax to refer to parts that are contained in a package.

有关此类派生自的抽象类以及请求和响应的操作的详细信息, 请参阅WebRequestFor more information about the abstract class that this class derives from and the operation of requests and responses, see WebRequest.

属性

AuthenticationLevel AuthenticationLevel AuthenticationLevel AuthenticationLevel

获取或设置用于此请求的身份验证和模拟的级别。Gets or sets values indicating the level of authentication and impersonation used for this request.

(Inherited from WebRequest)
CachePolicy CachePolicy CachePolicy CachePolicy

获取或设置 RequestCachePolicyGets or sets the RequestCachePolicy.

ConnectionGroupName ConnectionGroupName ConnectionGroupName ConnectionGroupName

获取或设置连接组的名称。Gets or sets the name of the connection group.

ContentLength ContentLength ContentLength ContentLength

获取或设置 Content-length HTTP 头。Gets or sets the Content-length HTTP header.

ContentType ContentType ContentType ContentType

获取或设置 Content-type HTTP 头。Gets or sets the Content-type HTTP header.

CreatorInstance CreatorInstance CreatorInstance CreatorInstance

当在子类中重写时,获取从 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.

(Inherited from WebRequest)
Credentials Credentials Credentials Credentials

获取或设置身份验证凭据。Gets or sets the authentication credentials.

Headers Headers Headers Headers

获取或设置与请求关联的标头名称/值对的集合。Gets or sets the collection of header name/value pairs associated with the request.

ImpersonationLevel ImpersonationLevel ImpersonationLevel ImpersonationLevel

获取或设置当前请求的模拟级别。Gets or sets the impersonation level for the current request.

(Inherited from WebRequest)
Method Method Method Method

获取或设置用于 Pack URI 请求的协议方法。Gets or sets the protocol method to use with the pack URI request.

PreAuthenticate PreAuthenticate PreAuthenticate PreAuthenticate

获取或设置一个值,该值指示是否对请求进行预身份验证。Gets or sets a value that indicates whether to preauthenticate the request.

Proxy Proxy Proxy Proxy

获取或设置 Internet 访问的网络代理。Gets or sets the network proxy for Internet access.

RequestUri RequestUri RequestUri RequestUri

获取与请求关联的资源的 URIURIGets the URIURI of the resource associated with the request.

Timeout Timeout Timeout Timeout

获取或设置请求超时前的时间长度。Gets or sets the length of time before the request times out.

UseDefaultCredentials UseDefaultCredentials UseDefaultCredentials UseDefaultCredentials

获取或设置默认的身份验证凭据。Gets or sets the default authentication credentials.

方法

Abort() Abort() Abort() Abort()

中止请求。Aborts the request.

(Inherited from WebRequest)
BeginGetRequestStream(AsyncCallback, Object) BeginGetRequestStream(AsyncCallback, Object) BeginGetRequestStream(AsyncCallback, Object) BeginGetRequestStream(AsyncCallback, Object)

当在子类中重写时,提供 GetRequestStream() 方法的异步版本。When overridden in a descendant class, provides an asynchronous version of the GetRequestStream() method.

(Inherited from WebRequest)
BeginGetResponse(AsyncCallback, Object) BeginGetResponse(AsyncCallback, Object) BeginGetResponse(AsyncCallback, Object) BeginGetResponse(AsyncCallback, Object)

当在子类中被重写时,开始对 Internet 资源的异步请求。When overridden in a descendant class, begins an asynchronous request for an Internet resource.

(Inherited from WebRequest)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
EndGetRequestStream(IAsyncResult) EndGetRequestStream(IAsyncResult) EndGetRequestStream(IAsyncResult) EndGetRequestStream(IAsyncResult)

当在子类中重写时,返回用于将数据写入 Internet 资源的 StreamWhen overridden in a descendant class, returns a Stream for writing data to the Internet resource.

(Inherited from WebRequest)
EndGetResponse(IAsyncResult) EndGetResponse(IAsyncResult) EndGetResponse(IAsyncResult) EndGetResponse(IAsyncResult)

当在子类中重写时,返回 WebResponseWhen overridden in a descendant class, returns a WebResponse.

(Inherited from WebRequest)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetInnerRequest() GetInnerRequest() GetInnerRequest() GetInnerRequest()

获取内部 WebRequestGets the inner WebRequest.

GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext) GetObjectData(SerializationInfo, StreamingContext)

使用将目标对象序列化所需的数据填充 SerializationInfoPopulates a SerializationInfo with the data needed to serialize the target object.

(Inherited from WebRequest)
GetRequestStream() GetRequestStream() GetRequestStream() GetRequestStream()

请不要使用 GetRequestStream(),它不受 PackWebRequest 支持。Do not use-GetRequestStream() is not supported by PackWebRequest.

GetRequestStreamAsync() GetRequestStreamAsync() GetRequestStreamAsync() GetRequestStreamAsync()

当在子类中被重写时,将用于写入数据的 Stream 作为异步操作返回到 Internet 资源。When overridden in a descendant class, returns a Stream for writing data to the Internet resource as an asynchronous operation.

(Inherited from WebRequest)
GetResponse() GetResponse() GetResponse() GetResponse()

返回请求的响应流。Returns the response stream for the request.

GetResponseAsync() GetResponseAsync() GetResponseAsync() GetResponseAsync()

当在子类中被重写时,将作为异步操作返回对 Internet 请求的响应。When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation.

(Inherited from WebRequest)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

当在子代类中重写时,使用序列化 SerializationInfo 所需要的数据来填充 WebRequest 实例。When overridden in a descendant class, populates a SerializationInfo instance with the data needed to serialize the WebRequest.

(Inherited from WebRequest)

适用于

另请参阅