RangeItemHeaderValue 类

定义

表示 Range 标头值中的字节范围。Represents a byte range in a Range header value.

public ref class RangeItemHeaderValue : ICloneable
public class RangeItemHeaderValue : ICloneable
type RangeItemHeaderValue = class
    interface ICloneable
Public Class RangeItemHeaderValue
Implements ICloneable
继承
RangeItemHeaderValue
实现

注解

RangeHeaderValue 类支持由 IETF 在RFC 2616中定义的范围标头中的字节范围。The RangeHeaderValue class provides support for a byte range in a Range header as defined in RFC 2616 by the IETF.

范围标头可以指定多个字节范围。A Range header can specify multiple byte ranges.

请求前100个字节的 HTTP 协议请求中的范围标头中的字节范围示例如下所示:An example of a byte-range in a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:

Range: bytes=0-99\r\n\r\n

HTTP 服务器指示支持范围标头和接受范围标头。A HTTP server indicates support for Range headers with the Accept-Ranges header. 支持字节范围的服务器的接受范围标头示例如下所示:An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:

Accept-Ranges: bytes\r\n\r\n

如果服务器的响应标头中未收到 Accept 范围的标头,则服务器不支持范围标头。If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. 不支持范围但可识别接受范围标头的服务器的 Accept 范围标头的示例如下所示:An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:

Accept-Ranges: none\r\n\r\n

构造函数

RangeItemHeaderValue(Nullable<Int64>, Nullable<Int64>)

初始化 RangeItemHeaderValue 类的新实例。Initializes a new instance of the RangeItemHeaderValue class.

属性

From

获取开始发送数据的位置。Gets the position at which to start sending data.

To

获取停止发送数据的位置。Gets the position at which to stop sending data.

方法

Equals(Object)

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

GetHashCode()

充当 RangeItemHeaderValue 对象的哈希函数。Serves as a hash function for an RangeItemHeaderValue object.

GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

显式接口实现

ICloneable.Clone()

创建作为当前 RangeItemHeaderValue 实例副本的新对象。Creates a new object that is a copy of the current RangeItemHeaderValue instance.

适用于