HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue HttpProductHeaderValue Class

Definition

Represents product information used by the HttpProductHeaderValue and HttpProductInfoHeaderValueCollection classes in the User-Agent HTTP header.

public : sealed class HttpProductHeaderValue : IStringable, IHttpProductHeaderValuepublic sealed class HttpProductHeaderValue : IStringable, IHttpProductHeaderValuePublic NotInheritable Class HttpProductHeaderValue Implements IStringable, IHttpProductHeaderValue// 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)

Constructors

HttpProductHeaderValue(String) HttpProductHeaderValue(String) HttpProductHeaderValue(String) HttpProductHeaderValue(String)

Initializes a new instance of the HttpProductHeaderValue class with a product name.

public : HttpProductHeaderValue(PlatForm::String productName)public HttpProductHeaderValue(String productName)Public Sub New(productName 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.

See Also

HttpProductHeaderValue(String, String) HttpProductHeaderValue(String, String) HttpProductHeaderValue(String, String) HttpProductHeaderValue(String, String)

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

public : HttpProductHeaderValue(PlatForm::String productName, PlatForm::String productVersion)public HttpProductHeaderValue(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

Name Name Name Name

Gets a token that represents the name of the product to be used in the User-Agent HTTP header.

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

The name of the product token

Version Version Version Version

Gets a token that represents the version of the product to be used in the User-Agent HTTP header.

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

The version of the product token.

Methods

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

Converts a string to an HttpProductHeaderValue instance.

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

A string that represents the product name and version.

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 name and version information.

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

Returns a string that represents the current HttpProductHeaderValue 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, HttpProductHeaderValue) TryParse(String, HttpProductHeaderValue) TryParse(String, HttpProductHeaderValue) TryParse(String, HttpProductHeaderValue)

Determines whether a string is valid HttpProductHeaderValue information.

public : static PlatForm::Boolean TryParse(PlatForm::String input, HttpProductHeaderValue productHeaderValue)public static bool TryParse(String input, HttpProductHeaderValue productHeaderValue)Public Static Function TryParse(input As String, productHeaderValue As HttpProductHeaderValue) 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 HttpProductHeaderValue information; otherwise, false.