Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2003
Posts: 6
Duckman Offline OP
Junior Member
OP Offline
Junior Member
Joined: Jul 2003
Posts: 6
im new to vb so pls dont critisize me.. anyway i dont know how to make a database.. i am trying to make a password protection program. I have the Account Name and Password text boxes and i need to make the database for the acc names and the passwords for the users... someone pls hlp...

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
The first question you need to ask yourself, is do you really NEED a database? It seems to me that if all you are gonna store is usernames and passwords, you should instead store usernames and passwords into a normal file and encrypt the information. Trust me, a user/pass file with encryption is easier than the database option.

So what will it be jack? database or file?


Domain Registration, Hosting, Management
http://www.dollardns.net
Joined: Jul 2003
Posts: 6
Duckman Offline OP
Junior Member
OP Offline
Junior Member
Joined: Jul 2003
Posts: 6
Thanks for the info SR. Only problem is that I have no experiance on how to encrypt text in files. Oh and I think I will go with the normal file. Thanks again.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
second question. Do you want to use a secure encryption algorithm that already exists out there on the internet and is used for many things, or do you want to use a simple encoding algorithm which can be broken by even the more amateur of crackers (like myself)?


Domain Registration, Hosting, Management
http://www.dollardns.net
Joined: Jul 2003
Posts: 6
Duckman Offline OP
Junior Member
OP Offline
Junior Member
Joined: Jul 2003
Posts: 6
What ever would be easiest until I learn the language. This is only a basic password form for my first program which will probably turn into trash lol. So I would probably have to say your second choice.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
Do you have any knowledge of file accessing in VB?


Domain Registration, Hosting, Management
http://www.dollardns.net
Joined: Jul 2003
Posts: 6
Duckman Offline OP
Junior Member
OP Offline
Junior Member
Joined: Jul 2003
Posts: 6
I have very little knowledge of VB whatsoever. Sorry if I'm such an idiot when it comes to this but I'm starting to learn.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
Here's the code to an example of how to save and load files. You tell the SaveFile subroutine the path of the file you'd like to save to, and the contents you'd like to save into it. The LoadFile function returns the file contents specified in the path you gave it. On Error Resume Next line tells VB to stuff their errors where the sun don't shine so that it doesn't crash your program if a file doesn't exist or there's permission errors or something.

Copy SaveFile and LoadFile and use in your project. Tell me when you get this code working good in your program and then we'll get a simple encoding algorithm to prevent easy snooping of the information in the file. Unless you don't care of the contents of the file is readable.

Private Sub Form_Load()
SaveFile "C:\example.txt", "hello" & vbcrlf & "bob"
MsgBox LoadFile("C:\example.txt")
End Sub

Private Sub SaveFile(Filename As String, Data As String)
On Error Resume Next
Open Filename For Output As #1
Print #1, Data;
Close #1
End Sub

Private Function LoadFile(Filename As String) As String
On Error Resume Next
Open Filename For Input As #1
LoadFile = Input(LOF(1), #1)
Close #1
End Function


Domain Registration, Hosting, Management
http://www.dollardns.net
Joined: Jul 2003
Posts: 6
Duckman Offline OP
Junior Member
OP Offline
Junior Member
Joined: Jul 2003
Posts: 6
Thanks SR but I'm having some troubles understanding this. How would I set it so that the program would load usernames and passwords from a text file? Also after that I will need help on simple encryption of the passwords and usernames that are in this text file. I'm sorry if I am causing any frustration to you and thank you very much for taking your time to help me.

Joined: Mar 2002
Posts: 1,273
DollarDNS Owner
Offline
DollarDNS Owner
Joined: Mar 2002
Posts: 1,273
You know what? Screw it. Let's go the INI file route cause it's easier. Add the following 2 lines to the top of your form code:

Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

Private Sub Form_Load()
SaveUser "John", "Doe"
MsgBox GetPass("John")
End Sub

Use the following 2 routines

Private Sub SaveUser(User As String, Pass As String)
WritePrivateProfileString "userlist", User, Pass, App.Path & "\users.ini"
End Sub

Private Function GetPass(User As String) As String
Dim Pass As String * 255, PassLength As Long
PassLength = GetPrivateProfileString("userlist", User, "", Pass, 255, App.Path & "\users.ini")
If PassLength > 0 Then GetPass = Left(Pass, PassLength)
End Function

Tell me if you can't figure out how to use this. The code above is all you need to know to save/load user information. Then comes the encoding.


Domain Registration, Hosting, Management
http://www.dollardns.net

Link Copied to Clipboard
Member Spotlight
Posts: 43
Joined: November 2002
Forum Statistics
Forums41
Topics33,840
Posts68,858
Average Daily Posts1
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Where and how do you torrent?
by danni75 - 03/01/24 05:58 AM
Animation,
by JohanKaariainen - 08/15/19 01:18 AM
Blackbeard.....
by Gremelin - 10/03/18 07:02 PM
my old account still exists!
by Crime - 08/10/18 02:47 PM
Okay WTF?
by HenryMiring - 09/27/17 01:45 AM
The History Thread...
by Gremelin - 08/11/17 12:11 PM
My friend NEEDS your HELP!
by Lena01 - 07/21/17 12:06 AM
I'm having fun with this guy.
by gabithompson730 - 07/20/17 01:50 AM
I want to upgrade my phone
by gabithompson730 - 07/20/17 01:49 AM
Doom 3
by Cyrez - 09/11/14 08:58 PM
Amazon Gift Card Generator/KeyGen?te
by Gecko666 - 08/22/14 09:21 AM
AIM scene 99-03
by lavos - 09/02/13 08:06 AM
Planetside 2
by Crime - 03/04/13 07:10 AM
Beta Testers Wanted
by Crime - 03/04/13 06:55 AM
Hello Everyone
by Gremelin - 02/12/12 06:01 PM
Tracfone ESN Generator
by Zanvin Green - 01/18/12 01:31 PM
Python 3 issue
by Testing - 12/17/11 09:28 PM
tracfone airtime
by Drache86 - 07/30/11 03:37 AM
Backdoors and the Infinite
by ZeroCoolStar - 07/10/11 03:52 AM
HackThisZIne #12 Releaseed!
by Pipat2 - 04/28/11 09:20 PM
gang wars? l33t-wars?
by Gremelin - 04/28/11 05:56 AM
Consolidate Forums
by diggin2deep - 04/21/11 10:02 AM
LAN Hacking Noob
by Gremelin - 03/12/11 12:42 AM
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
unreal 1
Crime 1
Ice 1
Dartur 1
Powered by UBB.threads™ PHP Forum Software 7.7.5