Hello
I want to make a program for certain people and I want it so that they need to enter a code the first time they run the program. The codes would need to be programmed into the program and a certain code would need to show certain info in the program ( for example: if someone entered code 12345 on the first startup the program would show 'welcome name'). If you need some extra explenation just ask.
I would like to know how to do this.
Bye and thanks in advance.

How to create a sort of login?
Jono378
I pretty much agree with Spotty. I start my main form invisible... and instantiate the login form. It's connected to database containing passwords and usernames and does user validation and evasion is necessary.
My form just passed back "logged in" or "wasn't logged in".
Farzin Davari
Tabdalla,
I'm sorry but in my programming I don't use SQL commands.
I could tell you how to do it in VB2005 but not with SQL.
fpsoft
Spotty,
Can you elaborate a little more on the comparison strings That's really the last part I have to complete in my app. I have custom IIdentity and IPrincipal objects that handle the authentication from the user input on the login form. Right now just to get things working, I hardcoded the username and password. I want to convert things to where the code compares the user input on the login form with what's stored in a "Users" table in a SQL 2005 database that contains the columns "UserID" (primary key), "Username", "Password", and "Role." I use the return vale of the role to either enable or disable controls on my forms.
If you could help me out with a code example on how to do the username and password comparison, I would really appreciate it!
Thanks in advance for any help,
Tony
P.S. Sorry to hijack the post, but I'm getting a little desparate to get this working!
Jubeh
You have a login form dialog as a template form type.
So add one to you project.
You need to instantiate an instance of this login form and show it from you main form. When you click OK you will use the username and password textbox text properties and determine if the code was correct by simple comparison operators.
If it is good - then set a property (or a variable in a module ) which determines the user name you have validated and this can then be retrieved from the original calling form.
Eric Donoho
Thats the general idea - my solution was very very crude and simple with simple comparison of strings but if you want to go more advanced then sure, you can create a database and pass them across to the database to validate the user identity there.
psycho_billy
Renee,
Thanks for the response. I've seen examples for storing the salted hash of a password in a db and ultimately, that's the route I'd like to take. For now though, I'd just like to start with a basic query utilizing my "UsersTableAdapter" to handle the comparison, get that working, then strengthen the security of the passwords from there...I'm just not sure how to configure the query for the comparison.
Hei
Renee,
Thanks very much for taking the time and posting your solution! It definitely gives me some ideas...
Dinus
They key concern is protection of the passwords. It is only the poorest of system that save strings.
The better ones I've seen do this... Let's say there was a password "Squibbish"
when first entered, 16 bit seed is collected and stored
Together Squbbish and the seed are processed in TransformX and turned into SomethingElse and SomethingElse is also stored.
When someone then enters a password, the seed and SomethingElse are located by the username. The seed and password are again processed and it's product is compared to somethingelse.
If they match you have a logon.
MarniW
Well what do you know
written from memory..... We have collected the username and passwword
End Function
Hows that
This is a gross simplification because I also had "Evasion" as part of the login scheme. If a user failed to log in three time within a rolling interval, the application hid for about 5 minutes as a security enhancement.
Shiloy
Renee,
I'd appreciate seeing how you would do it. If there's one thing I've learned doing this is there's always more than one (sometimes 4-5) way of doing things...
ispjka
K, I'm going to try it out tommorow.
Kevin111
Thinking.... I've done this in VB6....
Let me see if I can find a table...brb