dcsimg
Results 1 to 4 of 4

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

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2018
    Posts
    50

    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
    100,586

    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.
    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

    Thread Starter
    Member
    Join Date
    Jun 2018
    Posts
    50

    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
    100,586

    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.
    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

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