Utf8JsonWriter.WriteNumber 方法

定義

多載

WriteNumber(String, Int32)

寫入屬性名稱 (指定為字串) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, Int64)

寫入屬性名稱 (指定為字串) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, Single)

寫入屬性名稱 (指定為字串) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, UInt32)

寫入屬性名稱 (指定為字串) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, UInt64)

寫入屬性名稱 (指定為字串) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, Single)

寫入預先編碼的屬性名稱和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, Double)

寫入預先編碼的屬性名稱和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, Int32)

寫入預先編碼的屬性名稱和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, Int64)

寫入預先編碼的屬性名稱和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, Double)

寫入屬性名稱 (指定為字串) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, UInt32)

寫入預先編碼的屬性名稱和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, Decimal)

寫入預先編碼的屬性名稱和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, Decimal)

寫入屬性名稱 (指定為字串) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(JsonEncodedText, UInt64)

寫入預先編碼的屬性名稱和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, UInt32)

寫入屬性名稱 (指定為唯讀字元範圍) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, Decimal)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, Double)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, Int32)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, Int64)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, Single)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, UInt32)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, UInt64)

寫入屬性名稱 (指定為唯讀字元範圍) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, Decimal)

寫入屬性名稱 (指定為唯讀字元範圍) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, Double)

寫入屬性名稱 (指定為唯讀字元範圍) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, Int32)

寫入屬性名稱 (指定為唯讀字元範圍) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, Int64)

寫入屬性名稱 (指定為唯讀字元範圍) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Char>, Single)

寫入屬性名稱 (指定為唯讀字元範圍) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(ReadOnlySpan<Byte>, UInt64)

寫入屬性名稱 (指定為唯讀位元組範圍) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

WriteNumber(String, Int32)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為字串) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, int value);
public void WriteNumber (string propertyName, int value);
member this.WriteNumber : string * int -> unit
Public Sub WriteNumber (propertyName As String, value As Integer)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Int32

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

Int32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(String, Int64)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為字串) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, long value);
public void WriteNumber (string propertyName, long value);
member this.WriteNumber : string * int64 -> unit
Public Sub WriteNumber (propertyName As String, value As Long)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Int64

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

Int64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(String, Single)

來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs

寫入屬性名稱 (指定為字串) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, float value);
public void WriteNumber (string propertyName, float value);
member this.WriteNumber : string * single -> unit
Public Sub WriteNumber (propertyName As String, value As Single)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Single

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

Single使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G9'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(String, UInt32)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為字串) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (string propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : string * uint32 -> unit
Public Sub WriteNumber (propertyName As String, value As UInteger)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
UInt32

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

UInt32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(String, UInt64)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為字串) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (string propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : string * uint64 -> unit
Public Sub WriteNumber (propertyName As String, value As ULong)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
UInt64

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

UInt64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(JsonEncodedText, Single)

來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs

寫入預先編碼的屬性名稱和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, float value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, float value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * single -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Single)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
Single

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

Single使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G9'。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(JsonEncodedText, Double)

來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs

寫入預先編碼的屬性名稱和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, double value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, double value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * double -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Double)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
Double

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

Double使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G17'。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(JsonEncodedText, Int32)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入預先編碼的屬性名稱和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, int value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, int value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * int -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Integer)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
Int32

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

Int32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(JsonEncodedText, Int64)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入預先編碼的屬性名稱和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, long value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, long value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * int64 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Long)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
Int64

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

Int64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(String, Double)

來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs

寫入屬性名稱 (指定為字串) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, double value);
public void WriteNumber (string propertyName, double value);
member this.WriteNumber : string * double -> unit
Public Sub WriteNumber (propertyName As String, value As Double)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Double

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

Double使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G17'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(JsonEncodedText, UInt32)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入預先編碼的屬性名稱和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : System.Text.Json.JsonEncodedText * uint32 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As UInteger)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
UInt32

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

UInt32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(JsonEncodedText, Decimal)

來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs

寫入預先編碼的屬性名稱和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::Decimal value);
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, decimal value);
member this.WriteNumber : System.Text.Json.JsonEncodedText * decimal -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As Decimal)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
Decimal

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

Decimal使用預設 StandardFormat (寫入 ,也就是 'G') 。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(String, Decimal)

來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs

寫入屬性名稱 (指定為字串) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::String ^ propertyName, System::Decimal value);
public void WriteNumber (string propertyName, decimal value);
member this.WriteNumber : string * decimal -> unit
Public Sub WriteNumber (propertyName As String, value As Decimal)

參數

propertyName
String

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Decimal

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

propertyName 參數為 null

備註

Decimal使用預設 StandardFormat (寫入 ,也就是 'G') 。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(JsonEncodedText, UInt64)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入預先編碼的屬性名稱和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(System::Text::Json::JsonEncodedText propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (System.Text.Json.JsonEncodedText propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : System.Text.Json.JsonEncodedText * uint64 -> unit
Public Sub WriteNumber (propertyName As JsonEncodedText, value As ULong)

參數

propertyName
JsonEncodedText

要轉碼並寫入為 UTF-8 之 JSON 物件的 JSON 編碼屬性名稱。

value
UInt64

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

已啟用驗證,且此方法會導致寫入無效的 JSON。

備註

UInt64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

建立 的 JsonEncodedText 實例時,應該已經逸出屬性名稱。

適用於

WriteNumber(ReadOnlySpan<Char>, UInt32)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為唯讀字元範圍) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<char> propertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<char> * uint32 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As UInteger)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
UInt32

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

UInt32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, Decimal)

來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::Decimal value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, decimal value);
member this.WriteNumber : ReadOnlySpan<byte> * decimal -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Decimal)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
Decimal

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Decimal使用預設 StandardFormat (寫入 ,也就是 'G') 。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, Double)

來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, double value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, double value);
member this.WriteNumber : ReadOnlySpan<byte> * double -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Double)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
Double

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Double使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G17'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, Int32)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, int value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, int value);
member this.WriteNumber : ReadOnlySpan<byte> * int -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Integer)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
Int32

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Int32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, Int64)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, long value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, long value);
member this.WriteNumber : ReadOnlySpan<byte> * int64 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Long)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
Int64

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Int64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, Single)

來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs

寫入屬性名稱 (指定為唯讀位元組範圍) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, float value);
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, float value);
member this.WriteNumber : ReadOnlySpan<byte> * single -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As Single)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
Single

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Single使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G9'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, UInt32)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為唯讀位元組範圍) 和 UInt32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::UInt32 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, uint value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<byte> * uint32 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As UInteger)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
UInt32

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

UInt32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, UInt64)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為唯讀字元範圍) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<char> propertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<char> * uint64 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As ULong)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
UInt64

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

UInt64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, Decimal)

來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs
來源:
Utf8JsonWriter.WriteProperties.Decimal.cs

寫入屬性名稱 (指定為唯讀字元範圍) 和 Decimal 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, System::Decimal value);
public void WriteNumber (ReadOnlySpan<char> propertyName, decimal value);
member this.WriteNumber : ReadOnlySpan<char> * decimal -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Decimal)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Decimal

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Decimal使用預設 StandardFormat (寫入 ,也就是 'G') 。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, Double)

來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs
來源:
Utf8JsonWriter.WriteProperties.Double.cs

寫入屬性名稱 (指定為唯讀字元範圍) 和 Double 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, double value);
public void WriteNumber (ReadOnlySpan<char> propertyName, double value);
member this.WriteNumber : ReadOnlySpan<char> * double -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Double)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Double

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Double使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G17'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, Int32)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為唯讀字元範圍) 和 Int32 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, int value);
public void WriteNumber (ReadOnlySpan<char> propertyName, int value);
member this.WriteNumber : ReadOnlySpan<char> * int -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Integer)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Int32

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Int32使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, Int64)

來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.SignedNumber.cs

寫入屬性名稱 (指定為唯讀字元範圍) 和 Int64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, long value);
public void WriteNumber (ReadOnlySpan<char> propertyName, long value);
member this.WriteNumber : ReadOnlySpan<char> * int64 -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Long)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Int64

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Int64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Char>, Single)

來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs
來源:
Utf8JsonWriter.WriteProperties.Float.cs

寫入屬性名稱 (指定為唯讀字元範圍) 和 Single 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<char> propertyName, float value);
public void WriteNumber (ReadOnlySpan<char> propertyName, float value);
member this.WriteNumber : ReadOnlySpan<char> * single -> unit
Public Sub WriteNumber (propertyName As ReadOnlySpan(Of Char), value As Single)

參數

propertyName
ReadOnlySpan<Char>

要轉碼並寫入為 UTF-8 之 JSON 物件的 UTF-16 編碼屬性名稱。

value
Single

要以 JSON 數字寫入作為名稱/值組一部分的值。

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

Single使用 .NET Core 3.0 或更新版本上 'G') 的預設 StandardFormat (寫入 。 在任何其他架構上使用 'G9'。

屬性名稱會在寫入之前逸出。

適用於

WriteNumber(ReadOnlySpan<Byte>, UInt64)

來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs
來源:
Utf8JsonWriter.WriteProperties.UnsignedNumber.cs

重要

此 API 不符合 CLS 規範。

寫入屬性名稱 (指定為唯讀位元組範圍) 和 UInt64 值 (以 JSON 數字),作為 JSON 物件名稱/值組的一部分。

public:
 void WriteNumber(ReadOnlySpan<System::Byte> utf8PropertyName, System::UInt64 value);
[System.CLSCompliant(false)]
public void WriteNumber (ReadOnlySpan<byte> utf8PropertyName, ulong value);
[<System.CLSCompliant(false)>]
member this.WriteNumber : ReadOnlySpan<byte> * uint64 -> unit
Public Sub WriteNumber (utf8PropertyName As ReadOnlySpan(Of Byte), value As ULong)

參數

utf8PropertyName
ReadOnlySpan<Byte>

要寫入之 JSON 物件的 UTF-8 編碼屬性名稱。

value
UInt64

要以 JSON 數字寫入作為名稱/值組一部分的值。

屬性

例外狀況

指定的屬性名稱太大。

已啟用驗證,且寫入作業會產生無效的 JSON。

備註

UInt64使用預設 StandardFormat (寫入 ,也就是 'G') ;例如 32767。

屬性名稱會在寫入之前逸出。

適用於