HttpProductHeaderValue 类

定义

表示 User-Agent HTTP 标头中的 HttpProductHeaderValue 和 HttpProductInfoHeaderValueCollection 类使用的产品信息。

public ref class HttpProductHeaderValue sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpProductHeaderValueFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpProductHeaderValue final : IStringable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpProductHeaderValueFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpProductHeaderValue final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpProductHeaderValueFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpProductHeaderValue : IStringable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpProductHeaderValueFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpProductHeaderValue : IStringable
function HttpProductHeaderValue(productName, productVersion)
Public NotInheritable Class HttpProductHeaderValue
Implements IStringable
继承
Object Platform::Object IInspectable HttpProductHeaderValue
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

构造函数

HttpProductHeaderValue(String)

使用产品名称初始化 HttpProductHeaderValue 类的新实例。

HttpProductHeaderValue(String, String)

使用产品名称和产品版本初始化 HttpProductHeaderValue 类的新实例。

属性

Name

获取表示在 用户代理 HTTP 标头中使用的产品名称的令牌。

Version

获取表示要用于 User-Agent HTTP 标头的产品版本的令牌。

方法

Parse(String)

将字符串转换为 HttpProductHeaderValue 实例。

ToString()

返回表示当前 HttpProductHeaderValue 对象的字符串。

TryParse(String, HttpProductHeaderValue)

确定字符串是否为有效的 HttpProductHeaderValue 信息。

适用于

另请参阅