Results 1 to 10 of 10

Thread: Program makes its own settings?

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    37

    Program makes its own settings?

    Is it possible for a program to make new settings?

    To enter the settings name, type, scope, value?

    If yes how?
    If no what would you advice me to do instead?

    Thanks

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,371

    Re: Program makes its own settings?

    What are you trying to accomplish by doing so? I think that would be a better question to ask.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    37

    Re: Program makes its own settings?

    Im making a web browser bot and by this im trying to allow the user to save lots of settings... So i would need a way to store them.

    I dont want to pre-make the settings

    Thanks

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

    Re: Program makes its own settings?

    How do you usually save data from a program after it's been deployed? In a file or a database. My first choice would probably be an XML file, but it's completely up to you what format you use.
    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

  5. #5
    Member
    Join Date
    Dec 2010
    Posts
    56

    Re: Program makes its own settings?

    try using app.configs or my.settings

  6. #6

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    37

    Re: Program makes its own settings?

    Im a newbie so i dont know what i should do and how i should do it. Could someone tell me how i should do it and kick me in the right dirrection? or at tell me what i should google.

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

    Re: Program makes its own settings?

    Quote Originally Posted by TD5X View Post
    try using app.configs or my.settings
    Or not. My.Settings requires you to create the settings before deployment and the question was specifically about creating them after deployment. You could edit the config file but that would be a bad idea. Editing values in the config file programmatically is one thing but editing the schema is quite another. It's a far better option to create your own XML file, which you can read and write at startup and shutdown. You can define an element with a name and a value and add as many as you like. You could even use serialization, which would simplify the reading and writing code. You'd define a class that corresponded to that element and serialize a list of instances. You might want to add a data type too.
    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

  8. #8

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    37

    Re: Program makes its own settings?

    ok going to use that and do you know any tutorial at which i should have a look?

  9. #9

    Thread Starter
    Member
    Join Date
    Apr 2012
    Posts
    37

    Re: Program makes its own settings?

    someone?

  10. #10
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,371

    Re: Program makes its own settings?

    someone?
    Please be sure to check out "Do not open what ever you do" in my signature.

    If you decide to use an xml file, then check out the System.Xml Namespace. In the classes they have XML Textreader as well as XML writer. At the bottom of just about every class/method/ect. on msdn's library you'll find some wonderfull examples.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

Tags for this Thread

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