Registry.LocalMachine Alan

Tanım

Yerel makinenin yapılandırma verilerini içerir. Bu alan, Windows kayıt defteri temel anahtarı HKEY_LOCAL_MACHINE okur.

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 

Alan Değeri

Örnekler

Aşağıdaki örnek, bu anahtarın alt anahtarlarının nasıl alınduğunu gösterir ve adlarını ekrana yazdırır. OpenSubKey belirli bir ilgi alt anahtarının örneğini oluşturmak için yöntemini kullanın. Daha sonra bu anahtarı işlemek için içindeki RegistryKey diğer işlemleri kullanabilirsiniz.

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

Açıklamalar

LocalMachine beş anahtar içerir:

Donanım Bilgisayardaki fiziksel donanımı, cihaz sürücülerinin bu donanımı nasıl kullandığını ve çekirdek modu sürücülerini kullanıcı modu koduyla bağlayan eşlemeleri ve ilgili verileri açıklar. Sistem her başlatıldığında bu anahtardaki tüm veriler yeniden oluşturulur. Description alt anahtarı, gerçek bilgisayar donanımını açıklar. DeviceMap alt anahtarı, belirli sürücü sınıflarına özgü biçimlerde çeşitli veriler içerir. ResourceMap alt anahtarı, hangi cihaz sürücülerinin hangi donanım kaynaklarını talep ettiği açıklanmaktadır. Windows NT Tanılama programı (Winmsdp.exe) içeriğini kolay okunur bir biçimde raporlayabilir.

SAM Kullanıcı ve grup hesapları ve Windows 2000 Server'daki etki alanları için dizin hizmetleri güvenlik bilgileri veritabanı (SAM, dizin hizmetleri veritabanı olarak bilinen Güvenlik Hesabı Yöneticisi'dir).

Güvenlik Belirli kullanıcı hakları gibi yerel güvenlik ilkesini içerir. Bu anahtar yalnızca Windows 2000 güvenlik alt sistemi tarafından kullanılır.

Yazılım Bilgisayar başına yazılım veritabanı. Bu anahtar, çeşitli yapılandırma verilerinin çeşitli öğeleriyle birlikte yerel bilgisayarda yüklü yazılım hakkındaki verileri içerir.

Sistem Denetimleri sistem başlatma, cihaz sürücüsü yükleme, Windows 2000 hizmetleri ve işletim sistemi davranışı.

Kural gereği, içinde ve altında CurrentUserLocalMachinebenzer veriler varsa içindeki veriler CurrentUser önceliklidir. Ancak, bu anahtardaki değerler Registry.LocalMachine içindeki verileri de genişletebilir (değiştirmek yerine). Ayrıca, bazı öğeler (cihaz sürücüsü yükleme girdileri gibi) Registry.LocalMachine dışında oluşursa anlamsızdır.

Şunlara uygulanır