|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Instance Scoped SettingsI am writing an application that needs to be a multi-instance application.
With VB.NET 2005 this is pretty straight-forward except that I can not find any information about saving instance specific settings. The idea would be to have an instance identifier passed into the application from the command line that would identify the particular instance and then to use that to recover the settings specific to that instance. I realize this can be done using an XML or other format file but it seems that it should be possible to make use of a settings type class. At this time I have not found a way of doing this and would appreciate any suggestions, Sid. On 2007-10-31 13:34:44 -0700, "Sid Price" <s**@nowhere.com> said: Off the top of my head, I can't recall if the basic Settings class used > [...] The idea would be > to have an instance identifier passed into the application from the command > line that would identify the particular instance and then to use that to > recover the settings specific to that instance. I realize this can be done > using an XML or other format file but it seems that it should be possible to > make use of a settings type class. At this time I have not found a way of > doing this and would appreciate any suggestions, in VS 2005/.NET 2.0 supports targeting a specific file. But if not, I'm almost positive that the ConfigurationManager does. So, you could save and load settings that way. That should minimize or eliminate any need to write custom XML generation/parsing code. Of course, there's also always just regular serialization. You could create a class to save the settings, mark it as [Serializable] and then save/load an instance of that class to/from a specific FileStream. Pete |
|||||||||||||||||||||||