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, IHttpProductHeaderValue
public sealed class HttpProductHeaderValue : IStringable, IHttpProductHeaderValue
Public NotInheritable Class HttpProductHeaderValue Implements IStringable, IHttpProductHeaderValue
var httpProductHeaderValue = new httpProductHeaderValue(productName);
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)
var httpProductHeaderValue = new httpProductHeaderValue(productName);
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)
var httpProductHeaderValue = new httpProductHeaderValue(productName, productVersion);
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
var string = httpProductHeaderValue.name;
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
var string = httpProductHeaderValue.version;
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
var httpProductHeaderValue = Windows.Web.Http.Headers.HttpProductHeaderValue.parse(input);
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
var string = httpProductHeaderValue.toString();
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
var bool = Windows.Web.Http.Headers.HttpProductHeaderValue.tryParse(input, productHeaderValue);
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.