Results 1 to 3 of 3

Thread: [RESOLVED] Using the "Settings File" (Settings1.settings)

  1. #1

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Resolved [RESOLVED] Using the "Settings File" (Settings1.settings)

    I saw that you can also use a "Settings File" (Add new Item)to add your settings instead of the application settings.

    But I can't seem to write any values to the file. Someone with experience with the "Settings1.settings"?

    Thanks in advance


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  2. #2
    Addicted Member
    Join Date
    Jun 2009
    Posts
    245

    Re: Using the "Settings File" (Settings1.settings)

    Just add a new setting in vb, and then in your code you can add something like this

    Code:
            Settings1.connectionstring = "some connectionstring"
            Settings1.Save()
    Then you can load it later using
    Code:
    TextBox.Text = Settings1.connectionstring
    That is the most basic usage

  3. #3

    Thread Starter
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Using the "Settings File" (Settings1.settings)

    Thanks m8. Really helpfull.

    To write:

    vb.net Code:
    1. With Settings1.Default
    2.     .NameOfString = "something"
    3.     .Save
    4. End With

    To read:

    vb.net Code:
    1. YourControl.Value = Settings1.Default.NameOfString


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

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