Simple password/username question

daveofgv

Well-known member
Joined
Sep 17, 2008
Messages
218
Location
Dallas, TX
Programming Experience
1-3
Hello all,

I searched for my answer and didn't see it so if I posted this when there is another post with the same quesiton I am sorry.

I have a very easy question to most that know database in vb.net. I am using visual studio 2008.

I have a very complex application that I am making. I have a form called Admin Panel and need it protected by a user name and password.

I have a ms access database that I have connected to my application successfully. Everything is fine except the little code that is associated with my username password form.

**** How do I make it possible for the user to type the correct info and get sent to the Admin form that I have made (and if not correct a simple messbox that says Wrong username and/or password). And in admin I have a change password and username button - how do I make the form so the user can change the password and username?*****

Just to say that I am NOT in school. This is NOT a class project. And I am only making this for my own personal use......

**********************EDIT PART*************************
I am making an app so my daughter's can only visit certain website. I have 2 text files "url.inf and urlnames.inf' that I have already set and a list of arrays that pull the info from the text files and rename the buttons that they can choose from to visit the specific websites. EX disney.com nick.com and so forth.
Would it be easier to create another text file within my app that will store the username and password instead of using ms access?

And if so, how would I use the text files with the password and username form? (also, how to change the username and password in case my oldest daughter figures it out)

I am protecting the form that I use to add url's so my kids can't go in and change them. I deleted all icons for internet explorer so they are limited and can only visit the sites I agree to.
Thank you in advanced

daveofgv
 
Last edited:
Right now, I have a username and password hard coded into my program, however, I can not change it when using froms (change password form) when I compile it under setup and deployment.

Or Can I?

daveofgv
 
Thank you for you response.

Exactly what would I do? Are you saying a text file named settings or a system.settings?

And could you please be a little more open. I am still a newer vb.net programmer.....

daveofgv
 
Sorry.... I had a brain freeze. My kids were screaming in the background not wanting to go to bed...lol

Do you mean an app.config file (notepad)?

If so, I am not too familiar with app.config. I do have 2 .inf files that contain information with arrays that I can change on my form, but how exactly could I set up an app.config file to change my password? Also, could it be used to verify the password before changing?

Textbox1 = current password
Textbox2 = New password
Textbox3 = Verify New Password
Button1 = submit

would it be possible to walk me thru this?
I will be searching tutorials on setting one up, however, I want to make sure I do it right..

Thanks
daveofgv
 
vb.net how to use my.settings - Google Search

I wouldnt store the password in the settings, i'd store the .GetHashCode() of it, then you compare the .GetHashCode() of what the user typed with the contents of the settings file. This way it's protected from casual readers (without getting into the complexity of encrypted settigns files)

ps; do everyone a favour and rename your textboxes to soemthing sensible.. If you'd called your TextBox1 something like _usernameTextBox then you wouldnt have had to explain what it was!
 
cjard,

Thank you for the reply and the information. What you attached was exactly what I was looking for. I used textbox1 (and so forth) cause I thought it would be easier to describe in writing. My app, however, has usernametextbox and passtextbox....

I will use my real settings in future posts.

Thank you and I really appreciate your time and help.

daveofgv
 
I tried to simulate or sample and integrated it into my app, however, I got an error

"Configuration system failed to initialize"
Return CType(Me("PasswordHashCode"),String)

Any suggestions?
Could it be cause I don't have a username/password entered yet? If so, how do I add the first username and password in the app?

Sorry for all the questions, however, I am learning vb.net on my own.

daveofgv
 
Last edited:
You don't edit the app.onffig file directly...

On the project menu, choose properties,
Now look on the SETTINGS tab on the left

It looks a bit like this: (not my image, ignore highlighted words, illuatration purposes only)
AppSettings2005.jpg
 
posting on the forum would be better. When you z ip your project, remove teh BIN and OBJ folders

Thanks
 

Latest posts

Back
Top