ActivityTraceId ActivityTraceId ActivityTraceId ActivityTraceId Struct

定義

代表以 W3C 標準作為格式基礎的 TraceIdRepresents a TraceId whose format is based on a W3C standard.

public value class ActivityTraceId : IEquatable<System::Diagnostics::ActivityTraceId>
public struct ActivityTraceId : IEquatable<System.Diagnostics.ActivityTraceId>
type ActivityTraceId = struct
Public Structure ActivityTraceId
Implements IEquatable(Of ActivityTraceId)
繼承
ActivityTraceIdActivityTraceIdActivityTraceIdActivityTraceId
實作

備註

ActivityTraceId結構會反映 W3C 標準針對整個追蹤的識別碼所需的格式。The ActivityTraceId structure reflects the format that the W3C standard requires for the ID of the entire trace. 它包含16個位元組, 通常表示為32的十六進位字元。It consists of 16 bytes, typically represented as 32 hexadecimal characters. TraceId屬性ActivityTraceId會傳回。An ActivityTraceId is returned by the TraceId property.

ActivityTraceId因為是包含16個位元組的結構, 所以可以輕鬆地以傳址方式傳遞。Because an ActivityTraceId is a structure that contains 16 bytes, it can be passed easily by reference. ActivityTraceId包含方法, 可在其十六進位字串表示中進行來回轉換、嘗試避免變更格式, 直到其必須存在, 並在建立之後快取其字串表示。ActivityTraceId contains methods for converting to and from its hexadecimal string representation, tries to avoid changing formats until it has to, and caches its string representation after it is created. 它主要是用來作為交換類型。It is mostly useful as an exchange type.

方法

CopyTo(Span<Byte>) CopyTo(Span<Byte>) CopyTo(Span<Byte>) CopyTo(Span<Byte>)

將目前 ActivityTraceId 的 16 個位元組複製到指定範圍。Copies the 16 bytes of the current ActivityTraceId to a specified span.

CreateFromBytes(ReadOnlySpan<Byte>) CreateFromBytes(ReadOnlySpan<Byte>) CreateFromBytes(ReadOnlySpan<Byte>) CreateFromBytes(ReadOnlySpan<Byte>)

從 16 位元組的唯讀範圍建立新 ActivityTraceId 值。Creates a new ActivityTraceId value from a read-only span of 16 bytes.

CreateFromString(ReadOnlySpan<Char>) CreateFromString(ReadOnlySpan<Char>) CreateFromString(ReadOnlySpan<Char>) CreateFromString(ReadOnlySpan<Char>)

從 32 個十六進位字元的唯讀範圍建立新 ActivityTraceId 值。Creates a new ActivityTraceId value from a read-only span of 32 hexadecimal characters.

CreateFromUtf8String(ReadOnlySpan<Byte>) CreateFromUtf8String(ReadOnlySpan<Byte>) CreateFromUtf8String(ReadOnlySpan<Byte>) CreateFromUtf8String(ReadOnlySpan<Byte>)

從 UTF8 編碼位元組唯讀範圍建立新的 ActivityTraceId 值。Creates a new ActivityTraceId value from a read-only span of UTF8-encoded bytes.

CreateRandom() CreateRandom() CreateRandom() CreateRandom()

根據隨機數字 (極可能是唯一值) 建立新的 ActivitySpanIdCreates a new ActivitySpanId based on a random number (that is very likely to be unique).

Equals(ActivityTraceId) Equals(ActivityTraceId) Equals(ActivityTraceId) Equals(ActivityTraceId)

判斷目前的執行個體和指定的 ActivityTraceId 是否相等。Determines whether the current instance and a specified ActivityTraceId are equal.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷此執行個體和指定的物件 (同時還必須是 ActivityTraceId 執行個體) 是否有相同的值。Determines whether this instance and a specified object, which must also be an ActivityTraceId instance, have the same value.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回 TraceId 的雜湊碼。Returns the hash code of the TraceId.

ToHexString() ToHexString() ToHexString() ToHexString()

傳回代表此範圍識別碼的 16 字元十六進位字串。Returns a 16-character hexadecimal string that represents this span ID.

ToString() ToString() ToString() ToString()

傳回表示此追蹤識別碼的 32 字元十六進位字串。Returns a 32-character hexadecimal string that represents this trace ID.

運算子

Equality(ActivityTraceId, ActivityTraceId) Equality(ActivityTraceId, ActivityTraceId) Equality(ActivityTraceId, ActivityTraceId) Equality(ActivityTraceId, ActivityTraceId)

判斷兩個指定的 ActivityTraceId 執行個體是否有相同的值。Determines whether two specified ActivityTraceId instances have the same value.

Inequality(ActivityTraceId, ActivityTraceId) Inequality(ActivityTraceId, ActivityTraceId) Inequality(ActivityTraceId, ActivityTraceId) Inequality(ActivityTraceId, ActivityTraceId)

判斷兩個指定的 ActivityTraceId 執行個體是否有相同的值。Determines whether two specified ActivityTraceId instances have the same value.

適用於