JsonDocument JsonDocument JsonDocument JsonDocument Class

定義

提供機制用於檢查 JSON 值的結構化內容,而不需自動具現化資料值。Provides a mechanism for examining the structural content of a JSON value without automatically instantiating data values.

public ref class JsonDocument sealed : IDisposable
public sealed class JsonDocument : IDisposable
type JsonDocument = class
    interface IDisposable
Public NotInheritable Class JsonDocument
Implements IDisposable
繼承
JsonDocumentJsonDocumentJsonDocumentJsonDocument
實作

備註

這個類別會利用資源集區的記憶體,記憶體回收行程 (GC),以在高使用率案例的影響降到最低。This class utilizes resources from pooled memory to minimize the impact of the garbage collector (GC) in high-usage scenarios. 若未正確處置這個物件會導致不會傳回至集區,這會增加 GC 影響整個架構的各個部分的記憶體。Failure to properly dispose this object will result in the memory not being returned to the pool, which will increase GC impact across various parts of the framework.

屬性

RootElement RootElement RootElement RootElement

取得此 JSON 文件的根項目。Gets the root element of this JSON document.

方法

Dispose() Dispose() Dispose() Dispose()
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Parse(ReadOnlyMemory<Byte>, JsonReaderOptions) Parse(ReadOnlyMemory<Byte>, JsonReaderOptions) Parse(ReadOnlyMemory<Byte>, JsonReaderOptions) Parse(ReadOnlyMemory<Byte>, JsonReaderOptions)

將記憶體剖析為 UTF-8 編碼的文字,將單一 JSON 位元組值表示為 JsonDocument。Parses memory as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(ReadOnlyMemory<Char>, JsonReaderOptions) Parse(ReadOnlyMemory<Char>, JsonReaderOptions) Parse(ReadOnlyMemory<Char>, JsonReaderOptions) Parse(ReadOnlyMemory<Char>, JsonReaderOptions)

將表示單一 JSON 字元值的文字剖析為 JsonDocument。Parses text representing a single JSON character value into a JsonDocument.

Parse(ReadOnlySequence<Byte>, JsonReaderOptions) Parse(ReadOnlySequence<Byte>, JsonReaderOptions) Parse(ReadOnlySequence<Byte>, JsonReaderOptions) Parse(ReadOnlySequence<Byte>, JsonReaderOptions)

將序列剖析為 UTF-8 編碼的文字,將單一 JSON 位元組值表示為 JsonDocument。Parses a sequence as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(Stream, JsonReaderOptions) Parse(Stream, JsonReaderOptions) Parse(Stream, JsonReaderOptions) Parse(Stream, JsonReaderOptions)

Stream 剖析為 UTF-8 編碼的資料,將單一 JSON 值表示為 JsonDocument。Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. 資料流讀取完成。The stream is read to completion.

Parse(String, JsonReaderOptions) Parse(String, JsonReaderOptions) Parse(String, JsonReaderOptions) Parse(String, JsonReaderOptions)

將表示單一 JSON 字串值的文字剖析為 JsonDocument。Parses text representing a single JSON string value into a JsonDocument.

ParseAsync(Stream, JsonReaderOptions, CancellationToken) ParseAsync(Stream, JsonReaderOptions, CancellationToken) ParseAsync(Stream, JsonReaderOptions, CancellationToken) ParseAsync(Stream, JsonReaderOptions, CancellationToken)

Stream 剖析為 UTF-8 編碼的資料,將單一 JSON 值表示為 JsonDocument。Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. 資料流讀取完成。The stream is read to completion.

ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader)

從提供的讀取器剖析一個 JSON 值 (包括物件或陣列)。Parses one JSON value (including objects or arrays) from the provided reader.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)
TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument)

會嘗試從提供的讀取器剖析一個 JSON 值 (包括物件或陣列)。Attempts to parse one JSON value (including objects or arrays) from the provided reader.

適用於