Results 1 to 4 of 4

Thread: [RESOLVED] [2.0] Properties.Settings

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Location
    Taiwan
    Posts
    37

    Resolved [RESOLVED] [2.0] Properties.Settings

    i'm using C# vs2005
    when building winforms, i can store any setting configuration in the Properties.Settings.
    My question is : can i change the configuration programmatically ?
    because i got some error say that the Properties.Settings is read only.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [2.0] Properties.Settings

    I always code my own version of that class, gives me better flexibility. The Settings object itself may be readonly but its properties aren't (unless specifically defined).
    I don't live here any more.

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

    Re: [2.0] Properties.Settings

    Settings with Application scope are read-only. That's because they are stored in the main config file in the program folder, which users with limited accounts will not have write access to. Settings with User scope are read/write because a copy is stored under each user's Application Data folder. Every user is guaranteed to have write access to their own Application Data folder. Note though, that this means that if one user changes the setting values it will have no effect on any other users. This is a good thing in some situations and a bad thing in others. If I need to write to the main config file I implement my own class that does so through an XmlDocument object, but I always check that the current user has access to the folder first.
    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

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2006
    Location
    Taiwan
    Posts
    37

    Re: [2.0] Properties.Settings

    ok..
    thx for the info..

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