Utf8JsonReader.TryGetSingle(Single) 方法

定义

尝试将源中的当前 JSON 令牌值分析为 Single,并返回一个指示操作是否成功的值。Tries to parse the current JSON token value from the source as a Single and returns a value that indicates whether the operation succeeded.

public:
 bool TryGetSingle([Runtime::InteropServices::Out] float % value);
public bool TryGetSingle (out float value);
member this.TryGetSingle : single -> bool
Public Function TryGetSingle (ByRef value As Single) As Boolean

参数

value
Single

在此方法返回时,包含已解析的值。When this method returns, contains the parsed value.

返回

Boolean

如果可以将整个 UTF-8 编码令牌值成功解析为 Single 值,则为 true;否则为 falsetrue if the entire UTF-8 encoded token value can be successfully parsed to an Single value; otherwise, false.

例外

JSON 令牌值不是 NumberThe JSON token value isn't a Number.

适用于

另请参阅