PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2010 Settings file-VBForums
Results 1 to 8 of 8

Thread: Settings file

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Settings file

    I am looking to make a "user.settings" file or something similar that stores information for my application. I'm not sure how I would read a text file per line and do something depending on what it says.

    Thanks in advanced
    Self-taught 14 year old VB.NET, C#, HTML, CSS, and PHP programmer.

  2. #2
    Addicted Member
    Join Date
    Feb 2008
    Location
    California
    Posts
    151

    Re: Settings file

    Why dont you create XML to store such information.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Settings file

    Quote Originally Posted by itspramod View Post
    Why dont you create XML to store such information.
    I've never exactly gotten XML working with VB.NET. I was going to create an entire program once, but I couldn't get XML to read from my web URL. Could you shed some light?
    Self-taught 14 year old VB.NET, C#, HTML, CSS, and PHP programmer.

  4. #4
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Settings file

    Why reinvent the wheel? VS has a built-in mechanism for this with the "My.Settings" namespace.
    If you go to your "Project > [ProjectName] Properties" from the toolbar, then click the "Settings" tab on the left. You can store users' settings there.

    In the code you would do:

    vb Code:
    1. My.Settings.WorldSetting = "World" 'To Set
    2. Label1.Text = "Hello " & My.Settings.WorldSetting 'To Get

    Settings are saved when the application is closed, but can be saved explicitly whenever you want.

    MSDN: http://msdn.microsoft.com/en-us/libr...11(VS.80).aspx

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Settings file

    They reset on each Clickonce update.
    Self-taught 14 year old VB.NET, C#, HTML, CSS, and PHP programmer.

  6. #6
    Addicted Member
    Join Date
    Feb 2008
    Location
    California
    Posts
    151

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Posts
    23

    Re: Settings file

    Thank you!
    Self-taught 14 year old VB.NET, C#, HTML, CSS, and PHP programmer.

  8. #8
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    Re: Settings file

    Not sure if it applies to VS2010, I use VB2008 Express, but see the link: Import My.Settings from previous build version in my signature.

    Hope this helps.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

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