Results 1 to 7 of 7

Thread: [RESOLVED] What is the best way to persist application license information?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Resolved [RESOLVED] What is the best way to persist application license information?

    For a VB.Net Windows Forms application, targeting Framework 4.8, I need to persist license data that must be effective application-wide, and remain so permanently (unless and until it is modified by the application itself). In other words, the data must be consistent regardless of which user is running the application, and it must survive the application being uninstalled and then re-installed.

    Due to both the application's architecture and its likely usage patterns, it's important that the license data NOT be stored in the application's database. What I'm unsure about is:
    1. My guess is that the Windows registry would be the storage location of choice, but I'm open to other suggestions.
    2. If the data is stored in the registry, I would need to avoid those branches that apply to specific users, but I'm not sure which branch or other location would be best for application-wide data.
    3. Are Interaction.SaveSetting() and Interaction.GetSetting() the preferred methods for writing and reading registry data, or would some other choice be better?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: What is the best way to persist application license information?

    1. There might be better methods
    2. Try HKey LocalMachine
    3. ?

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

    Re: What is the best way to persist application license information?

    Quote Originally Posted by silverblatt View Post
    3. Are Interaction.SaveSetting() and Interaction.GetSetting() the preferred methods for writing and reading registry data, or would some other choice be better?
    Those are holdovers from VB6. .NET has dedicated types for working with the Registry. You can find examples with a web search.
    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

  4. #4
    New Member BigInteger's Avatar
    Join Date
    Apr 2023
    Posts
    5

    Re: What is the best way to persist application license information?

    I think registry HKEY_LOCAL_MACHINE\Software\Your_App_name would work well. But it needs admin rights to write data to that location.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2010
    Posts
    74

    Re: What is the best way to persist application license information?

    Rather than messing with the Registry, I ended up storing the date in hidden, read-only, system files in C:\ProgramData\[application_name], and that's working well.

  6. #6
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,169

    Re: [RESOLVED] What is the best way to persist application license information?

    There are no such things in practice as either hidden or read-only files. Hidden files are very easily found and the read-only attribute can just as easily be removed.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: [RESOLVED] What is the best way to persist application license information?

    A password protected database would be more secure…

Tags for this Thread

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