HeaderUtilities.TryParseSeconds Metoda

Definice

Zkuste najít cílovou hodnotu záhlaví mezi sadou zadaných hodnot záhlaví a parsovat ji jako TimeSpanhodnotu .

public:
 static bool TryParseSeconds(Microsoft::Extensions::Primitives::StringValues headerValues, System::String ^ targetValue, [Runtime::InteropServices::Out] Nullable<TimeSpan> % value);
public static bool TryParseSeconds (Microsoft.Extensions.Primitives.StringValues headerValues, string targetValue, out TimeSpan? value);
static member TryParseSeconds : Microsoft.Extensions.Primitives.StringValues * string * Nullable -> bool
Public Shared Function TryParseSeconds (headerValues As StringValues, targetValue As String, ByRef value As Nullable(Of TimeSpan)) As Boolean

Parametry

headerValues
StringValues

Obsahuje StringValues sadu hodnot hlaviček, které se mají hledat.

targetValue
String

Hodnota cílové hlavičky, kterou chcete vyhledat.

value
Nullable<TimeSpan>

Když tato metoda vrátí, obsahuje parsované TimeSpan, pokud analýza byla úspěšná, nebo null, pokud analýza selhala. Převod selže, pokud targetValue nebyl nalezen nebo ho nelze analyzovat jako TimeSpan. Tento parametr se předá neinicializovaný; všechny hodnoty původně zadané ve výsledku budou přepsány.

Návraty

Boolean

true pokud targetValue je nalezen a úspěšně parsován; jinak, false.

Platí pro