JsonReaderState(JsonReaderOptions) 建構函式

定義

建構新的 JsonReaderState 執行個體。

public JsonReaderState (System.Text.Json.JsonReaderOptions options = default);
new System.Text.Json.JsonReaderState : System.Text.Json.JsonReaderOptions -> System.Text.Json.JsonReaderState
Public Sub New (Optional options As JsonReaderOptions = Nothing)

參數

options
JsonReaderOptions

定義不同於 JSON RFC 的自訂 Utf8JsonReader 行為 (例如處理註解的方式,或讀取時允許的最大深度)。 根據預設,Utf8JsonReader 會嚴格遵循 JSON RFC (JSON 內的註解無效),且最多可讀取最大深度 64。

例外狀況

最大深度設定為非正數值 (< 0)。

備註

這個狀態的實例必須傳遞至 Utf8JsonReader 具有 JSON 資料的建構函式。 Utf8JsonReader不同于 是 ref 結構,狀態可以跨非同步/await 界限存留,因此需要此類型才能以非同步方式讀取更多資料,才能繼續進行 的新實例 Utf8JsonReader

適用於