Registry.PerformanceData フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Registry.PerformanceData フィールドの意味・解説 

Registry.PerformanceData フィールド

ソフトウェア コンポーネントパフォーマンスに関する情報格納してます。このフィールドには、Windows レジストリ基本キー HKEY_PERFORMANCE_DATA が読み込まれます。

名前空間: Microsoft.Win32
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared ReadOnly PerformanceData
 As RegistryKey
Dim value As RegistryKey

value = Registry.PerformanceData
public static readonly RegistryKey PerformanceData
public:
static initonly RegistryKey^ PerformanceData
public static final RegistryKey PerformanceData
public static final var
 PerformanceData : RegistryKey
解説解説

ソフトウェア コンポーネントインストールすると、そのコンポーネントオブジェクト、つまりカウンタキー作成されコンポーネント実行時に、カウンタ データ書き込まれます。このデータアクセスするには、その他のレジストリ データアクセスする場合同様に、RegistryKey 関数使用します

レジストリ使用してパフォーマンス データ収集しますが、収集したデータレジストリ データベースには格納されません。このキー記述されているレジストリアクセスすると、適切なシステム オブジェクト マネージャからデータ収集されます。

ローカル システムからパフォーマンス データ取得するには、Registry.PerformanceData キー指定した GetValue メソッド使用します最初呼び出しでこのキー開かれます。初めにキー明示的に開く必要はありません。パフォーマンス データ取得完了したら、必ず Close メソッド使用してこのキーへのハンドル閉じてくださいパフォーマンス データ使用されている間は、ユーザーソフトウェア コンポーネントインストールまたは削除できません。

リモート システムからパフォーマンス データ取得するには、リモート システムコンピュータ名と Registry.PerformanceData キー指定した OpenRemoteBaseKey メソッド使用する必要があります。このメソッド呼び出すと、リモート システムパフォーマンス データを表すキー取得されます。データ取得するには、Registry.PerformanceData キーではなくこのキー使用して GetValue呼び出します。

メモメモ

Windows Server 2003 では、ユーザーがこの基本キーのサブキーにアクセスするには、少なくとも Performance Monitor Users グループ属している必要があります

使用例使用例

このキーのサブキーを取得し、これらのサブキーの名前を画面出力する方法の例を次に示します必要な特定のサブキーのインスタンス作成するには、OpenSubKey メソッド使用します次にRegistryKey別の演算使用して、そのキー操作します。パフォーマンス データない場合があるため、この例では結果返されないことがある点に注意してください

Imports System
Imports Microsoft.Win32

Class Reg
    
    Public Shared Sub Main()
        
        ' Create a RegistryKey, which will access the HKEY_PERFORMANCE_DATA
 
        ' key in the registry of this machine.
        Dim rk As RegistryKey = Registry.PerformanceData
        
        ' Print out the keys.
        PrintKeys(rk)
    End Sub    
    
    Shared Sub PrintKeys(rkey As
 RegistryKey)
        
        ' Retrieve all the subkeys for the specified key.
        Dim names As String()
 = rkey.GetSubKeyNames()
        
        Dim icount As Integer
 = 0
        
        Console.WriteLine("Subkeys of " & rkey.Name)
        Console.WriteLine("-----------------------------------------------")
        
        ' Print the contents of the array to the console.
        Dim s As String
        For Each s In  names
            Console.WriteLine(s)
            
            ' The following code puts a limit on the number
            ' of keys displayed.  Comment it out to print the
            ' complete list.
            icount += 1            
            If icount >= 10 Then
                Exit For
            End If
        Next s
    End Sub
End Class
using System;
using Microsoft.Win32;

class Reg {
    public static void Main()
 {

        // Create a RegistryKey, which will access the HKEY_PERFORMANCE_DATA
        // key in the registry of this machine.
        RegistryKey rk = Registry.PerformanceData;

        // Print out the keys.
        PrintKeys(rk);
    }

    static void PrintKeys(RegistryKey rkey)
 {

        // Retrieve all the subkeys for the specified key.
        String [] names = rkey.GetSubKeyNames();

        int icount = 0;

        Console.WriteLine("Subkeys of " + rkey.Name);
        Console.WriteLine("-----------------------------------------------");

        // Print the contents of the array to the console.
        foreach (String s in names) {
            Console.WriteLine(s);

            // The following code puts a limit on the number
            // of keys displayed.  Comment it out to print the
            // complete list.
            icount++;
            if (icount >= 10)
                break;
        }
    }
}
using namespace System;
using namespace Microsoft::Win32;
void PrintKeys( RegistryKey ^ rkey )
{
   
   // Retrieve all the subkeys for the specified key.
   array<String^>^names = rkey->GetSubKeyNames();
   int icount = 0;
   Console::WriteLine( "Subkeys of {0}", rkey->Name );
   Console::WriteLine( "-----------------------------------------------"
 );
   
   // Print the contents of the array to the console.
   System::Collections::IEnumerator^ enum0 = names->GetEnumerator();
   while ( enum0->MoveNext() )
   {
      String^ s = safe_cast<String^>(enum0->Current);
      Console::WriteLine( s );
      
      // The following code puts a limit on the number
      // of keys displayed.  Comment it out to print the
      // complete list.
      icount++;
      if ( icount >= 10 )
            break;
   }
}

int main()
{
   
   // Create a RegistryKey, which will access the HKEY_PERFORMANCE_DATA
   // key in the registry of this machine.
   RegistryKey ^ rk = Registry::PerformanceData;
   
   // Print out the keys.
   PrintKeys( rk );
}

import System.*;
import Microsoft.Win32.*;

class Reg
{
    public static void main(String[]
 args)
    {
        // Create a RegistryKey, which will access the HKEY_PERFORMANCE_DATA
        // key in the registry of this machine.
        RegistryKey rk = Registry.PerformanceData;
        // Print out the keys.
        PrintKeys(rk);
    } //main

    static void PrintKeys(RegistryKey rKey)
    {
        // Retrieve all the subkeys for the specified key.
        String names[] = rKey.GetSubKeyNames();
        int iCount = 0;

        Console.WriteLine("Subkeys of " + rKey.get_Name());
        Console.WriteLine("-----------------------------------------------");
        // Print the contents of the array to the console.
        String s = null;
        for (int iCtr = 0; iCtr < names.get_Length();
 iCtr++) {
            s = names[iCtr];
            Console.WriteLine(s);
            // The following code puts a limit on the number
            // of keys displayed.  Comment it out to print the
            // complete list.
            iCount++;
            if (iCount >= 10) {
                break;
            }
        }
    } //PrintKeys
} //Reg
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Registry.PerformanceData フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Registry.PerformanceData フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS