StringWithQualityHeaderValue 类

定义

表示具有可选质量的字符串标头值。Represents a string header value with an optional quality.

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

注解

StringWithQualityHeaderValue 类支持在由 IETF 使用RFC 2616中定义的某些标头中使用质量因子的字符串。The StringWithQualityHeaderValue class provides support for strings with a quality factor used in some headers as defined in RFC 2616 by the IETF.

通过质量因素,用户代理可以指示各种标头中各种选项的相对优先级别,包括 Accept、Accept、Accept 编码和 Accept 标头。Quality factors allow the user agent to indicate the relative degree of preference for various options in various headers including the Accept, Accept-Charset, Accept-Encoding, and Accept-Language headers. 质量使用范围0到1。Quality uses a scale from 0 to 1. 默认值为 q = 1。The default value is q=1.

构造函数

StringWithQualityHeaderValue(String)

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

StringWithQualityHeaderValue(String, Double)

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

属性

Quality

获取 StringWithQualityHeaderValue 对象的质量因子。Gets the quality factor from the StringWithQualityHeaderValue object.

Value

获取 StringWithQualityHeaderValue 对象中的字符串值。Gets the string value from the StringWithQualityHeaderValue object.

方法

Equals(Object)

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

GetHashCode()

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

GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
Parse(String)

将字符串转换为 StringWithQualityHeaderValue 实例。Converts a string to an StringWithQualityHeaderValue instance.

ToString()

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

TryParse(String, StringWithQualityHeaderValue)

确定一个字符串是否为有效的 StringWithQualityHeaderValue 信息。Determines whether a string is valid StringWithQualityHeaderValue information.

显式接口实现

ICloneable.Clone()

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

适用于