HttpProductInfoHeaderValue HttpProductInfoHeaderValue HttpProductInfoHeaderValue HttpProductInfoHeaderValue Class

Definition

Represents product information used in the User-Agent HTTP header on an HTTP request.

public : sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValuepublic sealed class HttpProductInfoHeaderValue : IStringable, IHttpProductInfoHeaderValuePublic NotInheritable Class HttpProductInfoHeaderValue Implements IStringable, IHttpProductInfoHeaderValue// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The HttpProductInfoHeaderValue class represents product information used in the User-Agent HTTP header on an HTTP request.

The User-Agent header contains information about the user agent originating the request. The User-Agent header can contain multiple product tokens, each followed by optional comments which together identify the user agent and any sub-products. By convention, the product identifiers are listed in decreasing order of their significance for identifying the user agent software. Each product identifier consists of a name and optional version.

Each instance of the HttpProductInfoHeaderValue contains either a value for the Product or Comment property, but not both simultaneously.

The UserAgent property on the HttpRequestHeaderCollection returns an HttpProductInfoHeaderValueCollection that contains HttpProductInfoHeaderValue objects.

Constructors

HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String) HttpProductInfoHeaderValue(String)

Initializes a new instance of the HttpProductInfoHeaderValue class with a product comment.

public : HttpProductInfoHeaderValue(PlatForm::String productComment)public HttpProductInfoHeaderValue(String productComment)Public Sub New(productComment As String)// You can use this method in JavaScript.
Parameters
productComment
PlatForm::String String String String

The product comment used in the User-Agent HTTP header.

See Also

HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String) HttpProductInfoHeaderValue(String, String)

Initializes a new instance of the HttpProductInfoHeaderValue class with a product name and version.

public : HttpProductInfoHeaderValue(PlatForm::String productName, PlatForm::String productVersion)public HttpProductInfoHeaderValue(String productName, String productVersion)Public Sub New(productName As String, productVersion As String)// You can use this method in JavaScript.
Parameters
productName
PlatForm::String String String String

The name of the product token used in the User-Agent HTTP header.

productVersion
PlatForm::String String String String

The version of the product token used in the User-Agent HTTP header.

See Also

Properties

Comment Comment Comment Comment

Gets the product comment from the HttpProductInfoHeaderValue used in the User-Agent HTTP header.

public : PlatForm::String Comment { get; }public string Comment { get; }Public ReadOnly Property Comment As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The product comment used in the User-Agent HTTP header.

Product Product Product Product

Gets the product from the HttpProductInfoHeaderValue used in the User-Agent HTTP header.

public : HttpProductHeaderValue Product { get; }public HttpProductHeaderValue Product { get; }Public ReadOnly Property Product As HttpProductHeaderValue// You can use this property in JavaScript.
Value
HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue

The product name and version used in the User-Agent HTTP header.

Methods

Parse(String) Parse(String) Parse(String) Parse(String)

Converts a string to an HttpProductInfoHeaderValue instance.

public : static HttpProductInfoHeaderValue Parse(PlatForm::String input)public static HttpProductInfoHeaderValue Parse(String input)Public Static Function Parse(input As String) As HttpProductInfoHeaderValue// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

A string that represents the product information.

Returns

Remarks

Below are the exceptions that this function throws.

E_INVALIDARG

The input parameter is null (Nothing in Visual Basic).

The input parameter is not valid product information.

ToString() ToString() ToString() ToString()

Returns a string that represents the current HttpProductInfoHeaderValue object.

public : PlatForm::String ToString()public string ToString()Public Function ToString() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

A string that represents the current object.

TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue) TryParse(String, HttpProductInfoHeaderValue)

Determines whether a string is valid HttpProductInfoHeaderValue information.

public : static PlatForm::Boolean TryParse(PlatForm::String input, HttpProductInfoHeaderValue productInfoHeaderValue)public static bool TryParse(String input, HttpProductInfoHeaderValue productInfoHeaderValue)Public Static Function TryParse(input As String, productInfoHeaderValue As HttpProductInfoHeaderValue) As bool// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

The string to validate.

Returns
PlatForm::Boolean bool bool bool

true if input is valid HttpProductInfoHeaderValue information; otherwise, false.