Firstly i just want to indicate that i can't speak english very well but i got enough for this topic i think.
I have a personal project, not an assigment or a homework. I'm trying to learn the logic of VB.NET and my project is non-profit.
My project is simple video streaming system. I added it to HWID protection , but its not useful. Most of notebooks around have the same HWID. So i decided to make it with a login system with username/password. Today i tried to make it with MsSQL 2008 but i think i screwed up at all. And i decided to make it simple; with text files.
I searched and searched all day long.. Tried almost everything but it doesn't work i don't know why.
And i found a sample code part on this site, it's useful for me.Here it is.
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim Usernamereader As String = "G:\Text1.txt"
Dim PasswordReader As String = "G:\Text2.txt"
Dim TextLineUser As String
Dim TextLinePass As String
Dim CountUser As Integer
Dim CountPass As Integer
Dim CharUser As Char
Dim CharPass As Char
If System.IO.File.Exists(Usernamereader) And System.IO.File.Exists(PasswordReader) = True Then
Dim objReaderUser As New System.IO.StreamReader(Usernamereader)
Dim objReaderPass As New System.IO.StreamReader(PasswordReader)
Do While objReaderUser.Peek() <> -1
CountUser = 0
For CountUser = 1 To 10
CountUser = CountUser + 1
TextLineUser = TextLineUser & CountUser - 1 & _
objReaderUser.ReadLine() & vbNewLine
Next
CharUser = GetChar(TextLineUser, 1)
Loop
Do While objReaderPass.Peek() <> -1
CountPass = 0
For CountPass = 1 To 10
CountPass = CountPass + 1
TextLinePass = TextLinePass & CountPass - 1 & _
objReaderPass.ReadLine() & vbNewLine
Next
CharPass = GetChar(TextLinePass, 1)
Loop
If txtUsername.Text = TextLineUser And txtPassword.Text = TextLinePass Then
MsgBox("you logged in!")
MsgBox(TextLineUser)
MsgBox(TextLinePass)
MsgBox(CountPass)
MsgBox(CountUser)
Else
MsgBox("not good")
MsgBox(TextLineUser)
MsgBox(TextLinePass)
MsgBox(CountPass)
MsgBox(CountUser)
End If
Else
MsgBox("file does not exist")
End If
I want to change this part
Dim Usernamereader As String = "G:\Text1.txt"
Dim PasswordReader As String = "G:\Text2.txt"
, and i tried to make this part allow me to enter links to my text files on dropbox.
I used this at my hwid code part and i've tried to adapt it to login system but i couldn't...
Now im stuck and don't know what to do this is why i joined and started this topic.
I want users login to program with their usernames and passwords which are saved on this files.

New Topic/Question
Reply



MultiQuote




|