Elixsur (10-07-2009)
Well im trying to make a login system that checks usernames and passwords. i can check fine against ../users/username/username.txt and password.txt
on the user's computer. but would like to check against mysql database.
Thats what i have so farCode:If TextBox4.Text = ""Then MsgBox("Error No Username Selected!", MsgBoxStyle.Critical) Else IfMy.Computer.FileSystem.DirectoryExists("c:iCodedusers" + TextBox1.Text + "") Then Dim Userread As System.IO.StreamReader = New System.IO.StreamReader("c:iCodedusers" + TextBox1.Text + "" + "username.txt") Dim Userline AsString Dim Passread As System.IO.StreamReader = New System.IO.StreamReader("c:iCodedusers" + TextBox1.Text + "" + "password.txt") Dim Passline AsString Do Passline = TextBox2.Text Userline = Userread.ReadLine() Console.WriteLine(passline) Console.WriteLine(userline) LoopUntil userline IsNothing If TextBox2.Text = ""Then MsgBox("Error Fill a password in", MsgBoxStyle.Critical) Else If Passline = Passread.ReadLine() = TrueThen MsgBox("Welcome!", MsgBoxStyle.Information) Form2.Show() Me.Hide() EndIf
Last edited by GG2GG; 03-22-2009 at 07:00 AM.
Elixsur (10-07-2009)
newfag's dont know how to code ?
Elixsur (10-07-2009)
Maybe combine with PHP? PHP commands are easy to combine with MYSQL..
“Those who control the past, control the future: who controls the present controls the past” ~ George Orwell
Its me, Dreamgun
they are!?:d
[IMG]https://i157.photobucke*****m/albums/t54/murckleman/nub1.jpg[/IMG]
Mother fucker, close your VB IDE right mo-effin now, if I see another line of VB written by you ima srs eat you :@
There are two types of tragedies in life. One is not getting what you want, the other is getting it.
If you wake up at a different time in a different place, could you wake up as a different person?
im good at vb what are you trying to do ? you just want vb to read a txt file and if the username & pass dont match to not login ?
great Job and thanks first but u don´t get one^^
Yep man , you should use PHP + mysql , first get urself a mysql server , or instal xampp on your pc , then write script for your self little example for log in without sql:
<?php
echo "<form method="post" action="">";
echo " Username: <input type="text" name="username"> <br/>";
echo " Password: <input type="password" name="password"> <br/>";
echo "<input type="submit" value="Log In">";
echo "<form/>";
$username = $_POST['username']
$password = $_POST['password']
if ($username == "OrX" && $password == "password") {
echo "Congrats you just logged in!";
}
else
{
echo "Gtfo nub , wrong username or pw!";
}
echo "Script by -OrX|=-";
?>
Good luck , i could help you out with php and stuff if you need help MSN:lauriadi@hotmail.com
-OrX|=-
I posted a basic working readfile function for you vb6 users but this thread is old and unwanted so I'm going to close it now but PM me if you have more questions.
Code:Private Sub CheckPass_Click() Dim variable1 As String Open "c:username.txt" For Input As #1 Input #1, variable1 Close #1 if username.txt = variable1 then MsgBox("Welcome!") End Sub