Sorry, not sure what to call it, but..

N3il

New member
Joined
Jan 8, 2006
Messages
2
Programming Experience
Beginner
I have a couple of forms, which are password protected..

I currently have the password stored as a string, but i have realised this gives me no scope to change it.

Is there any way i can store a variable as part of a project so if i make this to an exe it will be changeable during the life of the program?

Many thanks.

Neil
 
The Question is do you want that certain password remain changed after user closes the application? If ti's so then you have to use some database (text file, XML file, My Settings and even relational DB if you want).
Otherwise it will be always reseted when you exit from application).
If you are asking to change password only durring app lifetime then it suppose to be very easy. Just declare some variables for example:
Dim myPWD as String = "mypassword"
then you can change it to whatever you want (if it's string of course)
i.e
myPWD = "mynewpassword"
Also notice that certain variable must have either class scope or public.

Regards ;)
 
I do want the variables to stay changed when I update the password.

Is there any way to do this without using a database or other external file?
 
No! Except if you use My.Settings syntax.Settings are stored in XML files located either with the application executable or in the Documents and Settings/Username directory, depending on the scope of the setting. Setting can have either a User or Application scope, depending on whether the setting applies to the application in general or to a specific user.
 
With no external files you could store it in the registry.

The common solution is to put it in an application config file that you include with your project.
 
haha since i installed VS 2005 it seems i have already forgoten about config file. Shroomy you are right config file can be just replacement for a DB. And about the registry i ever hated it from reason that i hate applications that write into my registies so i have never made any piece of code to does that.
Regards ;)
 
kulrom said:
And about the registry i ever hated it from reason that i hate applications that write into my registies so i have never made any piece of code to does that.
Regards ;)

I whole heartedly agree!!!! But thats the only way I could think of with out an external file.
 
Back
Top