|
-
Apr 23rd, 2012, 12:13 PM
#1
Thread Starter
Member
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
-
Apr 23rd, 2012, 05:09 PM
#2
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.
-
Apr 23rd, 2012, 11:52 PM
#3
Thread Starter
Member
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
-
Apr 24th, 2012, 12:01 AM
#4
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.
-
Apr 24th, 2012, 12:19 AM
#5
Member
Re: Program makes its own settings?
try using app.configs or my.settings
-
Apr 24th, 2012, 12:23 AM
#6
Thread Starter
Member
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.
-
Apr 24th, 2012, 12:24 AM
#7
Re: Program makes its own settings?
 Originally Posted by TD5X
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.
-
Apr 24th, 2012, 12:30 AM
#8
Thread Starter
Member
Re: Program makes its own settings?
ok going to use that and do you know any tutorial at which i should have a look?
-
Apr 24th, 2012, 09:53 AM
#9
Thread Starter
Member
Re: Program makes its own settings?
-
Apr 24th, 2012, 10:24 AM
#10
Re: Program makes its own settings?
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.
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|