Registry 類別

定義

提供用於表示 Windows 登錄中根目錄機碼的 RegistryKey 物件,以及用於存取機碼/值組的 static 方法。

public ref class Registry abstract sealed
public ref class Registry sealed
public static class Registry
public sealed class Registry
[System.Runtime.InteropServices.ComVisible(true)]
public static class Registry
type Registry = class
[<System.Runtime.InteropServices.ComVisible(true)>]
type Registry = class
Public Class Registry
Public NotInheritable Class Registry
繼承
Registry
屬性

備註

如需此 API 的詳細資訊,請參閱 Microsoft.Win32.Registry 類別

欄位

ClassesRoot

定義文件的型別 (或類別) 以及與型別相關聯的屬性。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_CLASSES_ROOT。

CurrentConfig

包含非針對特定使用者的硬體相關組態資訊。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_CURRENT_CONFIG。

CurrentUser

包含有關目前使用者喜好設定的資訊。 這個欄位會讀取 Windows 登錄基底機碼 HKEY_CURRENT_USER。

DynData
已淘汰.

包含動態登錄資料。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_DYN_DATA。

LocalMachine

包含本機電腦的組態資料。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_LOCAL_MACHINE。

PerformanceData

包含軟體元件的效能資訊。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_PERFORMANCE_DATA。

Users

包含有關預設使用者組態的資訊。 這個欄位會讀取 Windows 登錄主要機碼 HKEY_USERS。

方法

GetValue(String, String, Object)

在指定的登錄機碼中,擷取與所指定名稱關聯的值。 如果在指定的機碼中找不到該名稱,則會傳回提供的預設值;如果指定的機碼不存在,則傳回 null

SetValue(String, String, Object)

在指定的登錄機碼上設定指定的名稱/值組。 如果指定的機碼不存在,則會建立它。

SetValue(String, String, Object, RegistryValueKind)

使用指定的登錄資料型別,在指定的登錄機碼上設定名稱/值組。 如果指定的機碼不存在,則會建立它。

適用於

另請參閱