共用方式為


CounterData.Value 屬性

定義

取得或設定計數器資料。

public:
 property long Value { long get(); void set(long value); };
public long Value { get; set; }
public long Value { [System.Security.SecurityCritical] get; [System.Security.SecurityCritical] set; }
member this.Value : int64 with get, set
[<get: System.Security.SecurityCritical>]
[<set: System.Security.SecurityCritical>]
member this.Value : int64 with get, set
Public Property Value As Long

屬性值

計數數據。

屬性

範例

如需範例,請參閱 System.Diagnostics.PerformanceData

備註

此特性為多執行緒應用程式提供安全存取計數器資料的能力。 如果效能是主要考量,請使用該 RawValue 屬性;但該 RawValue 屬性並非執行緒安全。

請注意,該 Value 屬性在 .NET Framework 3.5 中並非執行緒安全。

要增加計數值,請考慮使用 Increment or IncrementBy 方法。

適用於