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.登錄檔類別

欄位

名稱 Description
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。

方法

名稱 Description
GetValue(String, String, Object)

取得指定名稱中指定的登錄鍵對應值。 如果指定鍵中找不到該名稱,則會回傳你提供的預設值,或者 null 該鍵不存在。

SetValue(String, String, Object, RegistryValueKind)

在指定的登錄檔鍵上設定名稱/值對,使用指定的登錄檔資料型態。 若指定金鑰不存在,則會建立該金鑰。

SetValue(String, String, Object)

在指定的登錄鍵上設定指定的名稱/值對。 若指定金鑰不存在,則會建立該金鑰。

適用於

另請參閱