Registry.LocalMachine 필드

정의

로컬 컴퓨터에 대한 구성 데이터가 들어 있습니다. 이 필드는 Windows 레지스트리 기본 키 HKEY_LOCAL_MACHINE을 읽습니다.

public: static initonly Microsoft::Win32::RegistryKey ^ LocalMachine;
public static readonly Microsoft.Win32.RegistryKey LocalMachine;
 staticval mutable LocalMachine : Microsoft.Win32.RegistryKey
Public Shared ReadOnly LocalMachine As RegistryKey 

필드 값

예제

다음 예제에서는 이 키의 하위 키를 검색하고 해당 이름을 화면에 출력하는 방법을 보여 줍니다. 메서드를 OpenSubKey 사용하여 관심 있는 특정 하위 키의 instance 만듭니다. 그런 다음 의 RegistryKey 다른 작업을 사용하여 해당 키를 조작할 수 있습니다.

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_LOCAL_MACHINE
   // key in the registry of this machine.
   RegistryKey ^ rk = Registry::LocalMachine;
   
   // Print out the keys.
   PrintKeys( rk );
}
using System;
using Microsoft.Win32;

class Reg {
    public static void Main() {

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

        // 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;
        }
    }
}
Imports Microsoft.Win32

Class Reg
    
    Public Shared Sub Main()
        
        ' Create a RegistryKey, which will access the HKEY_LOCAL_MACHINE
        ' key in the registry of this machine.
        Dim rk As RegistryKey = Registry.LocalMachine
        
        ' 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

설명

LocalMachine 에는 5개의 키가 포함되어 있습니다.

하드웨어 컴퓨터의 물리적 하드웨어, 디바이스 드라이버가 해당 하드웨어를 사용하는 방법, 커널 모드 드라이버를 사용자 모드 코드와 연결하는 매핑 및 관련 데이터에 대해 설명합니다. 이 키의 모든 데이터는 시스템이 시작될 때마다 다시 만들어집니다. 설명 하위 키는 실제 컴퓨터 하드웨어를 설명합니다. DeviceMap 하위 키에는 특정 드라이버 클래스와 관련된 형식의 기타 데이터가 포함되어 있습니다. 디바이스 드라이버는 하드웨어 리소스를 클레임 ResourceMap 하위 키를 설명 합니다. Windows NT 진단 프로그램(Winmsdp.exe)은 읽기 쉬운 형식으로 내용을 보고할 수 있습니다.

SAM 사용자 및 그룹 계정 및 Windows 2000 Server의 도메인에 대한 보안 정보의 디렉터리 서비스 데이터베이스입니다(SAM은 디렉터리 서비스 데이터베이스라고 하는 보안 계정 관리자임).

보안 특정 사용자 권한과 같은 로컬 보안 정책을 포함합니다. 이 키는 Windows 2000 보안 하위 시스템에만 사용됩니다.

소프트웨어 컴퓨터별 소프트웨어 데이터베이스입니다. 이 키에는 로컬 컴퓨터에 설치된 소프트웨어에 대한 데이터와 기타 구성 데이터의 다양한 항목이 포함되어 있습니다.

시스템 제어 시스템 시작, 디바이스 드라이버 로드, Windows 2000 서비스 및 운영 체제 동작.

규칙에 따라 유사한 데이터가 아래 및 아래에 CurrentUserLocalMachine있는 경우 의 데이터가 CurrentUser 우선합니다. 그러나 이 키의 값은 Registry.LocalMachine에서 데이터를 바꾸는 대신 확장할 수도 있습니다. 또한 일부 항목 (예: 디바이스 드라이버 항목 로드 중)는 Registry.LocalMachine 외부에서 발생 하는 경우에 의미가 없습니다.

적용 대상