Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

Users Property

Location

My.Computer.Registry.Users

Syntax

Dim result As Microsoft.Win32.RegistryKey = _ My.Computer.Registry.Users

Description

The Users property returns a Microsoft.Win32.RegistryKey object that refers to the HKEY_USERS location in the Windows registry. This entry point is used primarily to store default settings for new Windows users.

Usage at a Glance

  • This property is read-only.

  • To access the settings for the current Windows user, use the My.Computer.Registry.CurrentUser property instead.

  • You must have sufficient security permissions to read or write keys and values in the registry.

Example

The following example displays all of the sub-elements of the HKEY_USERS registry key element in a listbox control. The example assumes that you are using this code on a form with a defined ListBox1 control.

ListBox1.DataSource = My.Computer.Registry.Users.GetSubKeyNames( )

Related Framework Entries

  • Microsoft.VisualBasic.MyServices.RegistryProxy.Users Property

  • Microsoft.Win32.Registry.Users Property

See Also

ClassesRoot Property, CurrentConfig Property, CurrentUser Property, DynData Property, GetValue Method, LocalMachine Property, PerformanceData Property, Registry Object, SetValue Method

Категории