如何以另一种语言而不是英语获取 .Net 方法信息 PerformanceCounterCategory CategoryHelp

发布于 2024-10-10 19:02:09 字数 1127 浏览 3 评论 0原文

我的母语不是英语。我希望你明白我的意思。 我编写的一些 Powershell 代码

显示计数器和类别的描述

 
    $n=@( ("Memory","Available MBytes"),
        ("Memory","Free System Page Table Entries"),
        )
$ppt = New-Object System.Diagnostics.PerformanceCounter $ppt2 = New-OBject System.Diagnostics.PerformanceCounterCategory

foreach( $it in $n){         
        $ppt.categoryName=$it[0]
        $ppt.counterName=$it[1]
        $ppt2.categoryName =$it[0]
        $var = $ppt2.categoryName
        $var2 = $ppt.counterName
        $ppt.instanceName =''

        echo "CategoryName  : $var " 
        echo  ( "Category Help : " + $ppt2.CategoryHelp) 
        echo "CounterName   : $var2" 
        echo ("CounterHelp   : " +  $ppt.counterHelp)  
        echo "" 
}

This gives me in CounterHelp and Category Help in English Description. How to get a German Description of that Counter or Category even i use English Windows. I have tried on a German Windows but it didn't work. If it is not possible on English windows. What did i wrong on German Windows? Thx

I am not native English Speaker . I hope you understand what i mean.
A bit Powershell code that i wrote

Show Descriptions of Counters and Category

 
    $n=@( ("Memory","Available MBytes"),
        ("Memory","Free System Page Table Entries"),
        )
$ppt = New-Object System.Diagnostics.PerformanceCounter $ppt2 = New-OBject System.Diagnostics.PerformanceCounterCategory

foreach( $it in $n){         
        $ppt.categoryName=$it[0]
        $ppt.counterName=$it[1]
        $ppt2.categoryName =$it[0]
        $var = $ppt2.categoryName
        $var2 = $ppt.counterName
        $ppt.instanceName =''

        echo "CategoryName  : $var " 
        echo  ( "Category Help : " + $ppt2.CategoryHelp) 
        echo "CounterName   : $var2" 
        echo ("CounterHelp   : " +  $ppt.counterHelp)  
        echo "" 
}

This gives me in CounterHelp and Category Help in English Description. How to get a German Description of that Counter or Category even i use English Windows. I have tried on a German Windows but it didn't work. If it is not possible on English windows. What did i wrong on German Windows? Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情感失落者 2024-10-17 19:02:09

您需要德语版的 Windows。我使用的是德语Windows 7版本。

要检索类别和计数器的德语帮助文本,您必须使用德语名称。

更改:

$n=@(("Memory","Available MBytes"))

为:

$n=@(("Arbeitsspeicher","Verfügbare MB"))

您将在注册表中找到英文类别和计数器名称:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009

德语名称:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\007

You need the german version of Windows. I use the german Windows 7 version.

To retrieve the german help text of the category and counter you must use the german names.

change:

$n=@(("Memory","Available MBytes"))

to:

$n=@(("Arbeitsspeicher","Verfügbare MB"))

You will find the english category and counter names in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009

The german names in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\007

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文