Constant Module Or File ?
-
When i first started VB6 i used to hard code constants into a separate Module. Then i moved on to using an ini file instead as this allowed me to change server paths and server names plus other info without the need for recompiling code. Now i'm onto and new to VB.NET i want to adopt a good practise and have started using an xml file instead which i then read into the application to initialise certain system properties. What i want to know is what other people are doing or is there a better standard that folks are using? Many Thanks
-
When i first started VB6 i used to hard code constants into a separate Module. Then i moved on to using an ini file instead as this allowed me to change server paths and server names plus other info without the need for recompiling code. Now i'm onto and new to VB.NET i want to adopt a good practise and have started using an xml file instead which i then read into the application to initialise certain system properties. What i want to know is what other people are doing or is there a better standard that folks are using? Many Thanks
don't know if this exist in 2003 but in 2005 there is a tab 'settings' on the properties of you'r project here you can give a settingname, type, scope and value this does exactly the same as what you do with the plus side that you can access these 'settings' in code like this: my.Settings.nameofsetting it basacly creates a xml file wich can be opened in notepad to alter it I always use this
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.
-
don't know if this exist in 2003 but in 2005 there is a tab 'settings' on the properties of you'r project here you can give a settingname, type, scope and value this does exactly the same as what you do with the plus side that you can access these 'settings' in code like this: my.Settings.nameofsetting it basacly creates a xml file wich can be opened in notepad to alter it I always use this
If my help was helpfull let me know, if not let me know why. The only way we learn is by making mistaks.
:-DExcellent, thanks. Just the thing i was looking for.