Click here to Skip to main content
15,888,062 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I basically want to know how to make variables that can be changed by the user in VB, like for changing a file path for programs that read files for example. I think one way would be to make a config file, but if I can do it without that it would be better for the sake of what I'm doing with it.

What I have tried:

This is something I've never attempted to do I'm not sure where to start so I haven't tried anything.
Posted
Updated 7-Mar-16 13:03pm
v2
Comments
Maciej Los 7-Mar-16 17:43pm    
You should start doing anything.

In addition to what ppolymorphe wrote:

Take a look here:

Using Application Settings and User Settings[^] - abstracts the file handling so that you can access the settings as properties

c# - Best practice to save application settings in a Windows Forms Application - Stack Overflow[^]

Where should I store my data?[^] - if you want to handle the file writing yourself
 
Share this answer
 
Comments
Member 12312671 8-Mar-16 16:55pm    
what I've learned from my class this past quarter is VB, so at the moment I'm trying to expand off of what I've learned about VB while I finish my degree. I may go back to ITT for programming after I complete my NSA degree. I really had fun in the programming class; it was something new and fun to learn.
Sascha Lefèvre 8-Mar-16 17:02pm    
All the above is general .NET, you can use it in VB no problem. The first link is MSDN, there are VB samples for sure. Second link is almost completely language-agnostic. Third link is shown with C# code but is almost the same in VB. Good luck! :)
Quote:
I think one way would be to make a config file, but if I can do it without that it would be better for the sake of what I'm doing with it.
It is the only way!
You have to use a config file to store all your settings that must persist between program runs.
No choice.
 
Share this answer
 
Comments
Member 12312671 8-Mar-16 16:49pm    
I figured as much, it honestly makes the most sense. thank you for the response! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900