Results 1 to 5 of 5

Thread: [2005] Accessing the Registry

  1. #1

    Thread Starter
    Fanatic Member Nove's Avatar
    Join Date
    Jul 2004
    Posts
    736

    [2005] Accessing the Registry

    Does vb.net provide any easy ways to determine values from the registry?
    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Accessing the Registry

    There's the Microsoft.Win32.Registry and .RegistryKey classes provided in the Framework. VB 2005 also provides the My.Computer.Registry object that has a property that corresponds to each registry hive and these are Microsoft.Win32.Registry objects.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [2005] Accessing the Registry

    check for savesetting and getsetting method, i think this is the fastest way to store values and retrieves them in and out of the regestry.

    i usually use them to save the last user adjustemnt of the forms. (height, width and position)

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Accessing the Registry

    SaveSetting and GetSetting should be avoided these days. They are not for general registry access. They access values under a VB- and application-specific key in the HKCU hive. They cannot access keys outside that specific area.
    The SaveSetting function adds the key to HKEY_CURRENT_USER\Software\VB and VBA Program Settings.
    .NET 2.0 has user-scoped settings to do what SaveSetting and GetSetting used to. Settings use the application config file, which is one of the recommended places for .NET apps to strore application data. It is recommended that the registry be avoided if possible by .NET apps as Microsoft is trying to reduce applications dependence on it. The registry has grown out of control and is a perfromance bottleneck on many systems, so if Microsoft can wean developers off using it it will at least prevent greater stress, if not relieve some of that which currently exists.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [2005] Accessing the Registry

    Dear jmcilhinney,
    that was a very useful piece of information, still experience outranks youth .

    i think framework 2.0 fixes a lot in the world of .net

    again thank you for sharing knowledge

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width