creating a login form in vb express edition


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: creating a login form in vb express edition

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    58

    creating a login form in vb express edition

    I want to create a login form where the user enters a password. the user shall be able to create, change the password and delete it too. how can this be done?

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    That's too much code to expect someone to write for you for free. When your users enter a username and password, against what do you intend to authenticate them? Frequently, authentication systems use a database to store user credentials. So the process would look like this:

    Design a login form with textboxes for username and password, and a command button labeled Login. When the user clicks the Login button, open a connection to the database and query the database for something like, SELECT COUNT(*) FROM Users WHERE username = <value from username textbox> and password = <value from password textbox>. If the query returns a value greater than 0, the user exists in the database and is authenicated.

    If you want this application to be highly secure, it's not a good idea to store passwords in the database plain text. Instead, you should use a hashing function, such as those available in .NET's System.Cryptogrpahy namespace, to hash the password when the user creates it and store the hash in the database. Then when the user comes back to login, hash what they type in the password textbox and compare that value with the hash stored in the database.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Feb 2007
    Posts
    58
    sure i wasn't looking for someone to write code for me. - i just needed an explanation on how to go about creating this as i knew that i need to use a database which stores username and passwords but was not sure on how to query it.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Feb 2007
    Posts
    58
    thanks i'll have a look at that. by the way, if im using vb express edition, should i use sql server express edition for the DB?

  6. #6
    Join Date
    Feb 2007
    Posts
    58
    For demo purposes, i have created a login form where a default password is used which the user uses to login. on another form (called change password) i have three textboxes. one of these are hidden and stores the default password in it. the 2nd textbox is used to enter the current password by the user. the 3rd textbox is used to enter the new password that the user wishes to change to. when i click on a button called 'change' the password changes.

    however, when the application stops running and the user wishes to login again, the default password has to be used again, instead of the new password that the user changed to. what can be done to store the new password and use this new password to login the next time the user logs in? can this be done without a database as i wish to use this login/change password for demo purposes

  7. #7
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You can store data in a database, or in a disk file, or in the Windows registry. The difficulty is, if you store the data on the user's PC they can change or delete it, so you'll have to decide how your app will behave if that happens.

    I would probably use VB's My.Settings feature to save the password: http://www.google.com/search?q=vb+my.settings
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Windows form designer generated code VB
    By Benjamin in forum .NET
    Replies: 2
    Last Post: 04-05-2006, 04:06 AM
  2. Changing the Shape of the VB Form
    By Narayan_Uvce in forum VB Classic
    Replies: 4
    Last Post: 02-13-2006, 03:45 AM
  3. Replies: 0
    Last Post: 04-16-2002, 05:44 PM
  4. outlook express 6 with VB
    By santhosh in forum VB Classic
    Replies: 0
    Last Post: 02-27-2002, 06:37 AM
  5. Replies: 0
    Last Post: 07-01-2000, 04:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center