Visual Basic Language Reference 
My.Computer.Registry Object 

Provides properties and methods for manipulating the registry.

Remarks

To use these properties, you must have Read and Write permission from the RegistryPermissionAccess Enumeration. Any code running with full trust (under the default security policy, this is any code installed on the user's local hard drive) has the necessary permissions to access the registry. For more information, see RegistryPermission Class.

Tasks

The following table lists examples of tasks involving the My.Computer.Registry object.

Example

This example reads the value Name from HKEY_CURRENT_USER\Software\MyApp and displays it in a message box.

Visual Basic
Dim readValue As Object
        readValue = My.Computer.Registry.GetValue _
        ("HKEY_CURRENT_USER\Software\MyApp", "Name", Nothing)
        MsgBox("The value is " & CStr(readValue))
Requirements

Namespace: Microsoft.VisualBasic.MyServices

Class: RegistryProxy (provides access to Registry)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

See Also

Tasks

Walkthrough: Creating a Registry Key and Changing Its Values
Troubleshooting: Manipulating the Registry

Reference

My.Computer.Registry Object Members
My.Computer.Registry.ClassesRoot Property
My.Computer.Registry.CurrentConfig Property
My.Computer.Registry.CurrentUser Property
My.Computer.Registry.DynData Property
My.Computer.Registry.LocalMachine Property
My.Computer.Registry.PerformanceData Property
My.Computer.Registry.Users Property
My.Computer.Registry.GetValue Method
My.Computer.Registry.SetValue Method
My.Computer Object
Microsoft.Win32.Registry

Concepts

Common Registry Tasks

Tags :


Page view tracker