dcsimg
Results 1 to 4 of 4

Thread: [RESOLVED] How to save,get, and delete value from registry?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    64

    Resolved [RESOLVED] How to save,get, and delete value from registry?

    Hi all,

    Ho to convert these vb.net registry codes to C# codes
    Code:
    TextBox1.Text = GetSetting("app", "1", "key")
    SaveSetting("app", "1", "key", TextBox1.Text)
    DeleteSetting("app", "1", "key")
    Any help will be appreciated

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    101,658

    Re: How to save,get, and delete value from registry?

    In actual fact, the equivalent of those functions is to not use the Registry at all. They access an specific location in the Registry that is dedicated to the current application and that whole mechanism has been replaced application settings. So, the correct approach is to add settings for your application on the Settings page of the project properties and then access them via Project.Settings.Default in code.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    64

    Re: How to save,get, and delete value from registry?

    Quote Originally Posted by jmcilhinney View Post
    In actual fact, the equivalent of those functions is to not use the Registry at all. They access an specific location in the Registry that is dedicated to the current application and that whole mechanism has been replaced application settings. So, the correct approach is to add settings for your application on the Settings page of the project properties and then access them via Project.Settings.Default in code.
    So could you please tell me how to do that as an example?
    because I am begginer to C#
    Thanks in advance

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    101,658

    Re: How to save,get, and delete value from registry?

    You should do some reading on applications settings, rather than relying on a single specific example. If you had checked out the Settings page that I directed you to then you'd have found that it provides a link to further information.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width