Download here;; http://www.patcamp.co.uk/simple%20login%20system.rar
Screenshots;
Form1 Code;
Form2 Code;Code:Public Class Form1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.Close() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo A Dim Username As New System.IO.StreamReader(CurDir() & "/" & TextBox1.Text & ".txt") Dim Username2, Password As String Username2 = Username.ReadLine() Password = Username.ReadLine() Username.Close() If Password = TextBox2.Text Then MsgBox("Welcome" & " " & Username2) Else MsgBox("Wrong Password!") End If Exit Sub A: MsgBox("User does not exist!") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Form2.Show() Me.Close() End Sub End Class
Code:Imports System Imports System.IO Imports System.Text Public Class Form2 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click On Error GoTo A Dim stream_writer As New StreamWriter(CurDir() & "/" & TextBox1.Text & ".txt") Dim password1 As String Dim password2 As String Dim Username As String Username = TextBox1.Text password1 = TextBox2.Text password2 = TextBox3.Text If password1 & password2 = "" Then MsgBox("Please enter a password") End If If Username = "" Then MsgBox("Please enter a username") GoTo A End If If password1 = password2 Then stream_writer.WriteLine(TextBox1.Text) stream_writer.WriteLine(TextBox2.Text) stream_writer.Close() MsgBox("User Created!") Form1.Show() Me.Close() Else MsgBox("Passwords do not match!") End If A: End Sub End Class




Reply With Quote



