I'm making a login in system using one notepad document to store the usernames and passwords.

I was wondering if somebody could help me do this as at the moment I'm struggling to get it to match the username to the correct password.

For example:
On the first line of the notepad, I'd have the username: User.
On the 2nd line of the notepad, I'd have the password: Pass.

Now want I'm struggling to do is to get the system to read and match the username its correct password as well as being able to add new users to the list.

Heres basicly what I'm trying to do:

Text1.Text = "User"
Open notepad document
Find line that matchs "User"
Read Next Line = Password
If Text2.Text = Password
Then Login accepted
Else
Msgbox "Incorrect Password"
End If

sorry but y don u try storing ur usernames and passwords in an access and then combine the both as in notepad it is easily editable!
not much sure of hw to do in notepad thatz y!
-smile4evr

I've never done anything like that before. I'm fair new to VB haven't been doing it for very long.

Your more than welcome to explain or link a tutorial that'll teach me how to do it your way.

THIS can be done by making an adodc connection... this can be done by adding an adodc from components to the form... in the coding start decalre the connection like this

Public CN1 As New ADODB.Connection
Private rstSchema As ADODB.Recordset

then to access the table as soon as the form is loaded... add this..

Private Sub Form_Load()
Set CN1 = New ADODB.Connection
cString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Desktop\FINAL\file1.mdb"
With CN1
.ConnectionString = cString
.CommandTimeout = 20
.CursorLocation = adUseClient
.Open
End With

End Sub

this link is very important for anykind of programming!

http://msdn.microsoft.com/en-us/library/aa210706(office.11).aspx

i hope i was of some use coz im also quite new to programming!

good luck!
- smile4evr

See this project.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.