JsonDocument.WriteTo(Utf8JsonWriter) 方法

定義

將元素以 JSON 值形式寫入提供的寫入器。Writes the document to the provided writer as a JSON value.

public:
 void WriteTo(System::Text::Json::Utf8JsonWriter ^ writer);
public void WriteTo (System.Text.Json.Utf8JsonWriter writer);
member this.WriteTo : System.Text.Json.Utf8JsonWriter -> unit
Public Sub WriteTo (writer As Utf8JsonWriter)

參數

writer
Utf8JsonWriter

要將文件寫入其中的寫入器。The writer to which to write the document.

例外狀況

writer 參數是 nullThe writer parameter is null.

ValueKindRootElement 會導致 JSON 無效。The ValueKind of this RootElement would result in invalid JSON.

JsonDocument 已經過處置。The parent JsonDocument has been disposed.

適用於