![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 18
Rep Power: 0
![]() |
Hey, can somebody show me how to setup a database for usernames and passwords as if I want to add a new user, I have to add to the code etc. Is there a way I can verify the username and password if they were contained in an extrenal file, preferably a password protected database. thanks
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
Well, looks like you'll have to write all that code yourself the hard way, in binary file handling mode. I've done a similar thing recently for a website. With things like this there is no other option - other methods (i.e. sequential and random) don't let you change the data before it's written to disk. My system works by opening the file, containing sets of usernames and password delimited in some way, using characters that won't occur in either the username or password (e.g. chr(255)). It then loads them into an array, and searches through it when checking the username and password. It's harder to code, but quicker and more efficient in the long run.
Also, if you have your data stored in a byte array before being written to disk, you can encrypt it yourself (I use the ready-made Blowfish algorithm - a quick Google will dig it up). An alternative is to use an external database. However most databases that could be easily interfaced, like Access and MySQL, stress that they are not designed for holding things likes passwords, as they are not guaranteeably secure. Part of the advantage of writing a "one-off" system yourself is that, even if people get hold of the file, they won't necessarily know how to read it, especially if you use the all-purpose ".dat" extension! There are probably ActiveX things out there that will do it for you, but if you write your own method, you'll know exactly how secure it is. |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Does it work yet, Rory, or are you still fiddling? That login thingy needs to work, damnit!
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
err...
Some of us sleep at 2 in the morning you know! |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
Ok you can use VB to store the usernames.
and passes Using the SaveSetting (function, method, ah, I get them confused) It will save it to the Registry. Private sub Form1_Click SaveSetting (Login,Logins,Passanduser,Text1.Text) End Sub You can call the setting later with GetSetting. using those fields again.
__________________
And there was much rejoicing... Yay.... |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Feb 2005
Posts: 18
Rep Power: 0
![]() |
im quite new to this prgramming business. I currently hava database that stores the passwords but the password is validated against the list index of each username. the passwords are obtained via a databar and the passwords are in a table e.g administratorpass: password davepass: dave. the password the user enters in the password box is validated using the text box containing the text exported from the database. but i have to add more code for each user. by the way, the password boxes are on the login form but are beyond the borders. i cant use any other components as this is in college and they have restricted acion to everything. if somebody could upload some code i would be chuffed.
thanks |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Feb 2005
Posts: 18
Rep Power: 0
![]() |
oh yea, because of the way the college has restricted everything that registry trick doesnt work, but i can see how it would work
|
|
|
|
|
|
#8 |
|
Newbie
Join Date: Feb 2005
Posts: 7
Rep Power: 0
![]() |
Couldn't you connect to a notepad file rather than an access database, or have you got to?
Jamie |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
|
registry restricted eh...That sucks..
__________________
And there was much rejoicing... Yay.... |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Feb 2005
Posts: 7
Rep Power: 0
![]() |
I just remember i had exactly what you were looking for on my laptop, however i sent my laptop off about a week ago to get repaired because i spilt tea on the keyboard Lol.
Jamie ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|