共用方式為


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

取得權杖,表示要用於 User-Agent HTTP 標頭的產品名稱。

Version

取得權杖,表示要用於 User-Agent HTTP 標頭的產品版本。

方法

Parse(String)

將字串轉換為 HttpProductHeaderValue 實例。

ToString()

會傳回代表目前 HttpProductHeaderValue 物件的字串。

TryParse(String, HttpProductHeaderValue)

判斷字串是否為有效的 HttpProductHeaderValue 資訊。

適用於

另請參閱