蛙蛙求助:请教.net 2.0里的PerformanceCounterCategoryType枚举问题。

onlytiancai 2005-10-22 11:35:17
蛙蛙求助:请教.net 2.0里的PerformanceCounterCategoryType枚举问题。
public string PerformanceObjectName = "MyEnterpriseApplication";
// create a collection...
CounterCreationDataCollection list = new CounterCreationDataCollection();

// go through each counter...
foreach(EnterpriseCounter counter in Counters)
{
// create some new data...
CounterCreationData data = new CounterCreationData();
data.CounterName = counter.Name;
data.CounterHelp = counter.HelpText;
data.CounterType = counter.Type;

// add it...
list.Add(data);
}

// create the category and all of the counters...
//PerformanceCounterCategory.Create(PerformanceObjectName, "", list);
PerformanceCounterCategory.Create(PerformanceObjectName,
"",
PerformanceCounterCategoryType.MultiInstance,
list);
就最后这句里的PerformanceCounterCategoryType.SingleInstance,MultiInstance,Unknown枚举的各个选项都是指什么呀。。
...全文
103 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
onlytiancai 2005-10-22
  • 打赏
  • 举报
回复
我找到了一些英文说明,谁给翻译一下呀。
http://msdn2.microsoft.com/en-us/library/9c5zx326
PerformanceCounterCategoryType Enumeration
Note: This enumeration is new in the .NET Framework version 2.0.

Indicates whether the performance counter category can have multiple instances.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

Members
Member name Description
MultiInstance The performance counter category can have multiple instances.
SingleInstance The performance counter category can have only a single instance.
Unknown The instance functionality for the performance counter category is unknown.

Remarks

There are two types of performance counter categories: single-instance and multi-instance. By default, a category is single-instance when it is created and becomes multi-instance when another instance is added. Categories are created when an application is set up, and instances are added at run time. In the .NET Framework version 1.0 and version 1.1, it is not necessary to know whether a performance counter category is multi-instance or single-instance. In the .NET Framework version 2.0, the PerformanceCounterCategoryType enumeration is used to indicate whether a performance counter can have multiple instances.

this page
onlytiancai 2005-10-22
  • 打赏
  • 举报
回复
N久没来CSDN,今天来问了三个问题,一个也没人回复,是周末的原因还是大家对.NET 2.0不感冒呀。

62,067

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧