RegistryKey.Name Właściwość

Definicja

Pobiera nazwę klucza.

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

Wartość właściwości

Bezwzględna (kwalifikowana) nazwa klucza.

Wyjątki

Jest RegistryKey zamknięty (nie można uzyskać dostępu do kluczy zamkniętych).

Przykłady

Ten przykład kodu jest częścią większego przykładu podanego RegistryKey dla klasy.

// Delete or close the new subkey.
Console::Write( "\nDelete newly created registry key? (Y/N) " );
if ( Char::ToUpper( Convert::ToChar( Console::Read() ) ) == 'Y' )
{
   Registry::CurrentUser->DeleteSubKeyTree( "Test9999" );
   Console::WriteLine( "\nRegistry key {0} deleted.", test9999->Name );
}
else
{
   Console::WriteLine( "\nRegistry key {0} closed.", test9999->ToString() );
   test9999->Close();
}
// Delete or close the new subkey.
Console.Write("\nDelete newly created registry key? (Y/N) ");
if(Char.ToUpper(Convert.ToChar(Console.Read())) == 'Y')
{
    Registry.CurrentUser.DeleteSubKeyTree("Test9999");
    Console.WriteLine("\nRegistry key {0} deleted.",
        test9999.Name);
}
else
{
    Console.WriteLine("\nRegistry key {0} closed.",
        test9999.ToString());
    test9999.Close();
}
' Delete or close the new subkey.
Console.Write(vbCrLf & "Delete newly created " & _
    "registry key? (Y/N) ")
If Char.ToUpper(Convert.ToChar(Console.Read())) = "Y"C Then
    Registry.CurrentUser.DeleteSubKeyTree("Test9999")
    Console.WriteLine(vbCrLf & "Registry key {0} deleted.", _
        test9999.Name)
Else
    Console.WriteLine(vbCrLf & "Registry key {0} closed.", _
        test9999.ToString())
    test9999.Close()
End If

Uwagi

Nazwa klucza zawiera ścieżkę bezwzględną tego klucza w rejestrze, zawsze rozpoczynając od klucza podstawowego, na przykład HKEY_LOCAL_MACHINE.

Dotyczy

Zobacz też