Registry.LocalMachine Veld
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Bevat de configuratiegegevens voor de lokale computer. Dit veld leest de Windows registerbasissleutel 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
Waarde van veld
Voorbeelden
In het volgende voorbeeld ziet u hoe u de subsleutels van deze sleutel ophaalt en de namen ervan op het scherm afdrukt. Gebruik de OpenSubKey methode om een exemplaar van de specifieke subsleutel van belang te maken. Vervolgens kunt u andere bewerkingen RegistryKey gebruiken om die sleutel te bewerken.
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
Opmerkingen
LocalMachine bevat vijf sleutels:
Hardware beschrijft de fysieke hardware op de computer, de manier waarop apparaatstuurprogramma's die hardware gebruiken en toewijzingen en gerelateerde gegevens die kernelmodusstuurprogramma's koppelen aan gebruikersmoduscode. Alle gegevens in deze sleutel worden telkens opnieuw gemaakt wanneer het systeem wordt gestart. De subsleutel Beschrijving beschrijft de werkelijke computerhardware. De DeviceMap-subsleutel bevat diverse gegevens in indelingen die specifiek zijn voor bepaalde klassen stuurprogramma's. De Subsleutel ResourceMap beschrijft welke apparaatstuurprogramma's claimen welke hardwareresources. Het Windows NT Diagnostics-programma (Winmsdp.exe) kan in een eenvoudig te lezen formulier rapporteren over de inhoud ervan.
SAM De database met adreslijstservices van beveiligingsgegevens voor gebruikers- en groepsaccounts en voor de domeinen in Windows 2000 Server (SAM is security Account Manager, ook wel de directoryservicesdatabase genoemd).
Beveiliging bevat het lokale beveiligingsbeleid, zoals specifieke gebruikersrechten. Deze sleutel wordt alleen gebruikt door het Windows 2000-beveiligingssubsysteem.
Software De softwaredatabase per computer. Deze sleutel bevat gegevens over software die op de lokale computer is geïnstalleerd, samen met verschillende items met diverse configuratiegegevens.
Systeembesturingselementen voor het opstarten van het systeem, laden van apparaatstuurprogramma's, Windows 2000-services en gedrag van het besturingssysteem.
Als vergelijkbare gegevens onder CurrentUser en onder LocalMachineelkaar bestaan, hebben de gegevens in CurrentUser de conventie voorrang. Waarden in deze sleutel kunnen echter ook gegevens uitbreiden (in plaats van vervangen) in Registry.LocalMachine. Sommige items (zoals vermeldingen voor het laden van apparaatstuurprogramma's) zijn ook betekenisloos als ze buiten Registry.LocalMachine voorkomen.