我已经创建了一个多实例性能计数器,并且我传递了混合大小写实例名称,但是当我通过代码和perfmon查看它们时,实例名称会以某种方式转换为小写.有谁知道如何防止这种情况?在google上找到了这个,认为Luke Zhang很高兴永远不会跟进.
Ala*_*SFT 11
我使用Reflector查看System.dll中SystemCounter的代码.在私有的Initialize事件中是这个小块:
this.sharedCounter = new SharedPerformanceCounter(categoryName.ToLower(CultureInfo.InvariantCulture), this.counterName.ToLower(CultureInfo.InvariantCulture), this.instanceName.ToLower(CultureInfo.InvariantCulture), this.instanceLifetime);
Run Code Online (Sandbox Code Playgroud)
我想这就是原因.