Read default data from a file?

brainleak

Well-known member
Joined
Dec 20, 2016
Messages
54
Location
Barcelona area
Programming Experience
3-5
A vb6 application I wrote years ago would read some default data (mainly pathes) from an ini file at program start.
Now I'm trying to rewrite it in vb.net and was wondering if there is a more convenient way to do this.
 
You could add them in Application Settings (project properties page), User scope if you need to change the stored value at runtime, Application scope for read-only values. Access them in code using My.Settings object, you can also bind control properties (like Text) to such a setting in designer. The underlying storage is a xml file, which replaced the ini file format long ago.
 
You could add them in Application Settings (project properties page), User scope if you need to change the stored value at runtime, Application scope for read-only values. Access them in code using My.Settings object, you can also bind control properties (like Text) to such a setting in designer. The underlying storage is a xml file, which replaced the ini file format long ago.
That's very nice. The more I get into Visual Studio the better I like it.

Now, I've tried to define a few test values as you suggest and it all works very nicely, but I don't see them in the xml file.
The idea is the end user is supposed to be allowed to make changes in these values by editing the file.
 
but I don't see them in the xml file.
Application Settings Architecture, see "Settings File Locations".
The idea is the end user is supposed to be allowed to make changes in these values by editing the file.
I wouldn't want users to touch such a "system file" for application, and would instead provide an interface for users to change setting values. If this was not suitable I would stay away from application settings and instead use my own (xml) file for storage and make it available for user editing for example in users Documents folder.
 
Application Settings Architecture, see "Settings File Locations".

I wouldn't want users to touch such a "system file" for application, and would instead provide an interface for users to change setting values. If this was not suitable I would stay away from application settings and instead use my own (xml) file for storage and make it available for user editing for example in users Documents folder.
For this particular project I have finally used your last suggestion.

Thanks a lot for your help.
 
Back
Top