HttpProductInfoHeaderValue Klasse

Definition

Stellt Produktinformationen dar, die im USER-Agent-HTTP-Header für eine HTTP-Anforderung verwendet werden.

public ref class HttpProductInfoHeaderValue sealed : IStringable
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.Headers.IHttpProductInfoHeaderValueFactory, 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 HttpProductInfoHeaderValue 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.IHttpProductInfoHeaderValueFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpProductInfoHeaderValue final : IStringable
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.Headers.IHttpProductInfoHeaderValueFactory), 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 HttpProductInfoHeaderValue : 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.IHttpProductInfoHeaderValueFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpProductInfoHeaderValue : IStringable
function HttpProductInfoHeaderValue(productName, productVersion)
Public NotInheritable Class HttpProductInfoHeaderValue
Implements IStringable
Vererbung
Object Platform::Object IInspectable HttpProductInfoHeaderValue
Attribute
Implementiert

Windows-Anforderungen

Gerätefamilie
Windows 10 (eingeführt in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)

Hinweise

Die HttpProductInfoHeaderValue-Klasse stellt Produktinformationen dar, die im USER-Agent-HTTP-Header für eine HTTP-Anforderung verwendet werden.

Der User-Agent-Header enthält Informationen zum Benutzer-Agent, der die Anforderung stammt. Der User-Agent-Header kann mehrere Produkttoken enthalten, gefolgt von optionalen Kommentaren, die den Benutzer-Agent und alle Unterprodukte identifizieren. Gemäß Konvention werden die Produktbezeichner in abnehmender Reihenfolge ihrer Bedeutung für die Identifizierung der Benutzer-Agent-Software aufgeführt. Jeder Produktbezeichner besteht aus einem Namen und einer optionalen Version.

Jede instance von HttpProductInfoHeaderValue enthält entweder einen Wert für die Product- oder Comment-Eigenschaft, aber nicht beide gleichzeitig.

Die UserAgent-Eigenschaft für die HttpRequestHeaderCollection gibt eine HttpProductInfoHeaderValueCollection zurück, die HttpProductInfoHeaderValue-Objekte enthält.

Konstruktoren

HttpProductInfoHeaderValue(String)

Initialisiert eine neue instance der HttpProductInfoHeaderValue-Klasse mit einem Produktkommentar.

HttpProductInfoHeaderValue(String, String)

Initialisiert eine neue instance der HttpProductInfoHeaderValue-Klasse mit einem Produktnamen und einer Version.

Eigenschaften

Comment

Ruft den Produktkommentar aus dem httpProductInfoHeaderValue ab, der im HTTP-Header des User-Agent verwendet wird.

Product

Ruft das Produkt aus dem HttpProductInfoHeaderValue ab, der im HTTP-Header des User-Agent verwendet wird.

Methoden

Parse(String)

Konvertiert eine Zeichenfolge in eine HttpProductInfoHeaderValue-instance.

ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle HttpProductInfoHeaderValue-Objekt darstellt.

TryParse(String, HttpProductInfoHeaderValue)

Bestimmt, ob eine Zeichenfolge gültige HttpProductInfoHeaderValue-Informationen ist.

Gilt für:

Weitere Informationen