Results 1 to 4 of 4

Thread: [2005] set app.config value

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    617

    [2005] set app.config value

    is there a missing line why the new values were not save to app.config?

    vb Code:
    1. <?xml version="1.0" encoding="utf-8" ?>
    2. <configuration>  
    3.   <appSettings>
    4.     <add key ="defaultuser" value ="Test"/>
    5.     <add key ="defaultpass" value ="1234abcd"/>
    6.   </appSettings>
    7. </configuration>


    vb Code:
    1. ConfigurationManager.AppSettings.Item("defaultuser") = userNameTextBox.Text.ToString
    2.         ConfigurationManager.AppSettings.Item("defaultpass") = passwordTextBox.Text.ToString

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

    Re: [2005] set app.config value

    Have you read the code in my Protected Configuration thread? There's more to saving changes to the actual config file than just that. All you're doing is editing VB objects held in memory.
    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
    Addicted Member
    Join Date
    May 2008
    Location
    Denmark
    Posts
    178

    Re: [2005] set app.config value

    OFFT: Isn't it a bit dumb to save user/pw in a text based file ?

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

    Re: [2005] set app.config value

    Quote Originally Posted by Link
    OFFT: Isn't it a bit dumb to save user/pw in a text based file ?
    Apparently YOU haven't read my Protected Configuration thread.
    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
  •  



Click Here to Expand Forum to Full Width