Before I type anything else I should warn you, I have very restrict knowledge of vb.net or any similar languages...
So, what I am trying to do is to get several textboxes, get the user to edit them, click a button and then a few labels would have the textbox text displayed... (textbox1 would be label1, etc)this is prety simple and I can do this very easily...but what I am looking for is that the labels text remain the ones the user has inputed after the program is stopped so that when it opens, the label already has that value...
Is there anyway I can save a label between program runs?
I have thought of various ways to do this...I think that if I used a database it'd be easy, but I do not believe that's the better way to do it...I thought of using an external .txt file and then read it, but I need several labels and I can't get the program to read each line individually and then pass it to a variable because I do not know how to work with arrays in vb.net...I am mainly asking you for source code...advice is apreciated but I do not think I could do much with it.
Go do a bit of research on My.Settings. That is probably the easiest way to do it.
If you need help with it, PM me.
~ZerO
Right-click on your Project in the Solution Explorer and click Properties. Click on the Settings tab. Click in the cell under name box and give your new Setting a name such as Username. Select string as the Type and type in a default setting in the Value box (this is optional). To get the setting simply use: My.Settings.Username.
Example:
My.Settings.Username = "Hello!"
To save the setting you must do this:
My.Settings.Username = "Hello!"
My.Settings.Save
My.Settings.Reload
You could save it to a file like a .dat or .ini . That is what i normally do.
thank you for the help, it works just as I want it to.