How to implement a user configuration for an Application by C#? [modified]
-
As I know, a real application has the ability to let users to change certain settings and alter the way the application runs, which is regarded as user configuration. Some settings will take the effect immediately after you click 'OK' while the program is running, some may request you to restart the program I am a complete novice for programming, though I have read so many text books about C#. All I know now is that like how to create classes, structures, define functions, callbacks, delegates, interfaces, declare variables and so forth. I totally have no idea about how to design a real application from scratch although I was thrown in this situation that I have to. I have partially completed the flowchart but I still don't understand how to persist and implement user configurations to make the application interactive? Thanks for anyone could give me some hints. -- modified at 23:13 Tuesday 25th September, 2007
Someone was born greatness; Someone achieved greatness; Someone have the greatness thrust upon him;
-
As I know, a real application has the ability to let users to change certain settings and alter the way the application runs, which is regarded as user configuration. Some settings will take the effect immediately after you click 'OK' while the program is running, some may request you to restart the program I am a complete novice for programming, though I have read so many text books about C#. All I know now is that like how to create classes, structures, define functions, callbacks, delegates, interfaces, declare variables and so forth. I totally have no idea about how to design a real application from scratch although I was thrown in this situation that I have to. I have partially completed the flowchart but I still don't understand how to persist and implement user configurations to make the application interactive? Thanks for anyone could give me some hints. -- modified at 23:13 Tuesday 25th September, 2007
Someone was born greatness; Someone achieved greatness; Someone have the greatness thrust upon him;
As you mentioned, you're a newbie in C#, so I think the most important thing to you is not the application interative but how to create a real application. You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
YouMiss wrote:
but I still don't understand that how to persist and implement user configurations to make the application interactive?
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
--------------------------------- Believe what you saw!
-
As you mentioned, you're a newbie in C#, so I think the most important thing to you is not the application interative but how to create a real application. You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
YouMiss wrote:
but I still don't understand that how to persist and implement user configurations to make the application interactive?
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
--------------------------------- Believe what you saw!
Dunbar C wrote:
You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
Thanks very much for your suggestion. But, if I could choose to start from all the fundamentals I would REALLY not put myself into this situation:).
Dunbar C wrote:
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
Someone was born greatness; Someone achieved greatness; Someone let the greatness thrust upon him;
-
Dunbar C wrote:
You can create some applications without thinking too much more, just let them run with simple features, such as IO, Registry, Graphics, etc. These can help you with further programming.
Thanks very much for your suggestion. But, if I could choose to start from all the fundamentals I would REALLY not put myself into this situation:).
Dunbar C wrote:
Since then, you shoule know this way: you can use XML document to save the user configuration and let the application "read" the user's settings and "implement" them. Use XML to store and read user configruation. That's "what you do", not "how to do".
I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
Someone was born greatness; Someone achieved greatness; Someone let the greatness thrust upon him;
YouMiss wrote:
I did read about that the C# (or maybe the .NET framework) supports the *.resx file format which is to persist all the external resources used for an application. However, upon what I read I haven't figured out how to modify a resource file at real-time. And yes, the resource file is making use of the XML file. Is it what you were just trying to say?
.resx file is mostly like a file stores base 64 string of images or the extra infos of design mode of a form, and as default it's build as "Embedded Resource" in VS2005 (see the properties of one form, there is a "Build Action" node at the properties window). If you want to read and write the use configuration, a good way is to use .xml file or .config file, the select the "Build Action" as "Content", and the property "Copy to Output Direactory" as "Copy if newer".
--------------------------------- Believe what you saw!
-
As I know, a real application has the ability to let users to change certain settings and alter the way the application runs, which is regarded as user configuration. Some settings will take the effect immediately after you click 'OK' while the program is running, some may request you to restart the program I am a complete novice for programming, though I have read so many text books about C#. All I know now is that like how to create classes, structures, define functions, callbacks, delegates, interfaces, declare variables and so forth. I totally have no idea about how to design a real application from scratch although I was thrown in this situation that I have to. I have partially completed the flowchart but I still don't understand how to persist and implement user configurations to make the application interactive? Thanks for anyone could give me some hints. -- modified at 23:13 Tuesday 25th September, 2007
Someone was born greatness; Someone achieved greatness; Someone have the greatness thrust upon him;
Take a look at the
System.Configuration
namespece (mostly within the System.Configuration.dll assembly) as this contains everything you need to read and write configuration settings for an application. -
Take a look at the
System.Configuration
namespece (mostly within the System.Configuration.dll assembly) as this contains everything you need to read and write configuration settings for an application.