ActivityTraceId.CreateFromString(ReadOnlySpan<Char>) 方法

定义

从一个包含 32 个十六进制字符的只读范围创建一个新的 ActivityTraceId 值。Creates a new ActivityTraceId value from a read-only span of 32 hexadecimal characters.

public:
 static System::Diagnostics::ActivityTraceId CreateFromString(ReadOnlySpan<char> idData);
public static System.Diagnostics.ActivityTraceId CreateFromString (ReadOnlySpan<char> idData);
static member CreateFromString : ReadOnlySpan<char> -> System.Diagnostics.ActivityTraceId
Public Shared Function CreateFromString (idData As ReadOnlySpan(Of Char)) As ActivityTraceId

参数

idData
ReadOnlySpan<Char>

一个包含 32 个十六进制字符的范围。A span that contains 32 hexadecimal characters.

返回

ActivityTraceId

新的跟踪 ID。The new trace ID.

例外

idData 不包含 16 个十六进制字符。idData does not contain 16 hexadecimal characters.

- 或 --or-

idData 中的字符并非全为小写的十六进制字符或全为零。The characters in idData are not all lower-case hexadecimal characters or all zeros.

注解

idData 可以包含数字和小写的十六进制字符或全部为零。idData can consist either of numbers and lower-case hexadecimal characters or of all zeros.

适用于