JsonElement.TryGetByte(Byte) 方法

定义

尝试以 Byte 形式表示当前 JSON 数字。Attempts to represent the current JSON number as a Byte.

public:
 bool TryGetByte([Runtime::InteropServices::Out] System::Byte % value);
public bool TryGetByte (out byte value);
member this.TryGetByte : byte -> bool
Public Function TryGetByte (ByRef value As Byte) As Boolean

参数

value
Byte

该方法返回时,如果转换成功,则包含与当前 JSON 数字等效的字节。When the method returns, contains the byte equivalent of the current JSON number if the conversion succeeded.

返回

Boolean

如果可以 Byte 形式表示数字,则为 true;否则为 falsetrue if the number can be represented as a Byte; otherwise, false.

例外

此值的 ValueKind 不是 NumberThis value's ValueKind is not Number.

已释放父级 JsonDocumentThe parent JsonDocument has been disposed.

注解

此方法不分析 JSON 字符串值的内容。This method does not parse the contents of a JSON string value.

适用于