Results 1 to 6 of 6

Thread: Storing data in Registry

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Arrow Storing data in Registry

    Hi,

    I want to store and retrieve the content of a listbox in registry. Now i am storing the content in a flat file and retrieving it. How to make use of the registry.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Storing data in Registry

    Why use the registry? That method was OK in the past, but now too many programs are filling up the registry with bloat. You'd do better keeping the flatfile, or using an INI file. Any reason for the change?

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Storing data in Registry

    The easiest way to save data to the registry is with GetSetting and SaveSetting.

    Is the reason for the change security?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Storing data in Registry

    It's easier to encrypt the flat file. That is 100% more secure.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    4

    Arrow Re: Storing data in Registry

    I am going to distribute my application as an exe. In my application i will get some files which is to be displayed(say some wav files). Now i am creating a flat file in the application path and storing the details and retrieving it, which i dont want to expose to user. So i need to store it in registry and retrive it. could you plz suggest some codes to store and retrieve from registry

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Storing data in Registry

    You could you the GetSetting and SaveSetting methods to write to the registry.
    They write to "HKEY_CURRENT_USER\Software\VB and VBA Program Settings".

    VB Code:
    1. SaveSetting App.Title, "Settings", "WavInfo", "C:\MyWav.wav"
    2. 'Then to retrieve:
    3. 'If you specify a value for the Default parameter, if no value is found it will use the parameter you specified
    4. GetSetting App.Title, "Settings", "WavInfo", "C:\Default.wav"
    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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