[RESOLVED] [2005] A Weird doubt with TextBox Control
hi frens.. :wave: :wave: :wave:
i am using a username and password textboxes on a form.
i just want to input username and password only once in those text boxes
after that how many ever times i run the project the same username
and password should be used.
if i want to change that username and password i gave for the 1st time
then i can use a button or any other control.
this should happen even after i publish the project as exe file and distribute
to my team members.
P.S:
my intention is to distribute this form as a exe file to my team members.
and i wish my team members may not type the username and password
everyday and everytime if they wish to run my exe file.
Can this happen with vs2005 text box component ? :thumb:
Re: [2005] A Weird doubt with TextBox Control
Check out My.Settings in 2005.
You can save that information and use it. Then if you want to change the details, chage the variable in settings and save them.
Re: [2005] A Weird doubt with TextBox Control
dear friend stimbo...
can u help me do it ?
Re: [2005] A Weird doubt with TextBox Control
If you check out on the taskbar: Project -> Properties -> Settings (Panel)
You will then be able to create variables there with values. You can create 2 string variables, one for username and one for password, including values.
In the form Load you can input the variables like this:
vb Code:
Me.UserNameBox.Text = My.Settings.userName
Re: [2005] A Weird doubt with TextBox Control
thanks stimbo...
but my intention is different from this one.
according to ur suggestion
the username and password always remains the same as wat i m goin to
give in value field of settings section.
but my intention is
when the exe file was run for the first time
it wil prompt for username and password.
after typing it and running.. the application wil never
prompt for username and password anymore.
but in case by chance if the user wish to input a different
username and different password after running the exe 10 or 20 or so many times then i have to supply a different control that helps the user to input
the new username and password.. and thereafter the newly inputted credentials will be used forever till the user again wishes to change it.
the explanation is very simple..
its like locking the textboxes with the user specified values.
and if needed unlocking it for new values and again locking it.
can this be possible ?
Re: [2005] A Weird doubt with TextBox Control
the use of my.settings is that it stores the default value that you want for your application. When the application is executed, you can check for the existence of the attributes userName and password, if there are not there, then it is the first time and you prompt for a username and password and save the info in the my.settings.
Whenever you want to change those values, just
vb Code:
my.settings.username = textbox1.text
Re: [2005] A Weird doubt with TextBox Control
i tried it friend.
it shows the value i gave in my settings.
but how to bring the value from the text box to this settings value field
during run time ?
Re: [2005] A Weird doubt with TextBox Control
This is a horible method for saving the username and password because it is stored in plain text. That means that anyone can access the username and password simply by opening the user.config file. Is security a concern in your app?
Re: [2005] A Weird doubt with TextBox Control
no it isnt... security isnt a big deal of concern for me..
coz i am just giving this app to my team mates.