Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在具有不同本地化的系统中按名称查找PerformanceCounterCategory_C#_Performancecounter - Fatal编程技术网

C# 在具有不同本地化的系统中按名称查找PerformanceCounterCategory

C# 在具有不同本地化的系统中按名称查找PerformanceCounterCategory,c#,performancecounter,C#,Performancecounter,我在设置了英语的机器上尝试了以下代码: PerformanceCounterCategory[] categories = PerformanceCounterCategory .GetCategories() .Where ( x => x.CategoryName == "Process" )

我在设置了英语的机器上尝试了以下代码:

 PerformanceCounterCategory[] categories = PerformanceCounterCategory
                                          .GetCategories()
                                          .Where ( x => x.CategoryName == "Process" )
                                          .ToArray()
它找到了一个条目,但是如果我在一台使用意大利语的机器上尝试相同的代码,我将无法找到任何类别,直到我用意大利语翻译它(例如:process变成processo)


我的问题是,我会避免为我在客户系统中找到的每种语言手动转换语言类别名称。

看到了吗?谢谢@Anton我以前错过了那个问题,但这正是我要找的。你看到了吗?谢谢@Anton我以前错过了那个问题,但这正是我要找的。
PerformanceCounterCategory[] categories = PerformanceCounterCategory
                                          .GetCategories()
                                          .Where(x = > x.CategoryName == "Processo")
                                          .ToArray()