PerformanceCounter.InstanceLifetime 属性

定义

获取或设置进程的生存期。

public:
 property System::Diagnostics::PerformanceCounterInstanceLifetime InstanceLifetime { System::Diagnostics::PerformanceCounterInstanceLifetime get(); void set(System::Diagnostics::PerformanceCounterInstanceLifetime value); };
public System.Diagnostics.PerformanceCounterInstanceLifetime InstanceLifetime { get; set; }
member this.InstanceLifetime : System.Diagnostics.PerformanceCounterInstanceLifetime with get, set
Public Property InstanceLifetime As PerformanceCounterInstanceLifetime

属性值

PerformanceCounterInstanceLifetime

PerformanceCounterInstanceLifetime 值之一。 默认值为 Global

例外

设置的值不是 PerformanceCounterInstanceLifetime 枚举的成员。

注解

如果使用 .NET Framework 版本 1.0 或 1.1 创建性能计数器类别,则它使用全局共享内存,并且其值InstanceLifetime必须为 Global。 如果.NET Framework版本 1.0 或 1.1 上运行的应用程序不使用该类别,请删除并重新创建该类别。

备注

CounterType如果属性值为 SingleInstanceInstanceLifetime则性能计数器的值必须为 Global

适用于