HeaderUtilities.TryParseSeconds 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試在指定標頭值的集合中尋找目標標頭值,並將其剖析為 TimeSpan 。
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
參數
- headerValues
- StringValues
, StringValues 包含要搜尋的標頭值集。
- targetValue
- String
要尋找的目標標頭值。
當這個方法傳回時,如果剖析成功,則包含已 TimeSpan 剖析的 ,如果剖析失敗則為 null。 如果 targetValue
找不到 或 無法剖析為 TimeSpan ,則轉換會失敗。 此參數會以未初始化的狀態來傳遞,並會覆寫任何原本在結果中提供的值。
傳回
true
如果 targetValue
找到並成功剖析,則為 ,否則為 false
。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應