First attempt at login system.
Download here;; http://www.patcamp.co.uk/simple%20login%20system.rar
Screenshots;
http://www.patcamp.co.uk/screeny.png
Form1 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
Form2 Code;
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
Re: First attempt at login system.
Good work.
That GUI is nice, but please make that label transparent.
Re: First attempt at login system.
wow that was nice
thanks for that, so cute, and u can use themes on vb
how did u do that
Re: First attempt at login system.
@Monsta.
The label wont go transparent over an picturuebox for some reason.
It was only there so I knew which test it was anyways.
@jcgo16
How did I do what?
I don't usnderstand the question excatly.
Re: First attempt at login system.
are u using vb2008?
or vb6?
if ur using vb6, how did u do that theming the form
Re: First attempt at login system.
I'm using VB2008.
+ I didnt use theming, its just a picture in a picturebox.
Re: First attempt at login system.
I must say, that is impressive. I, for one, quit VB.NET, because the idiots who made it, cant help me with an error that apparently cant get fixed. My properties box wont show any properties. I reinstalled VS2008 AND THE FRAMEWORKS, but it was no use.
Re: First attempt at login system.
Give proper names to your buttons and other objects.
Re: First attempt at login system.
@Jeffijoe; Thanks, and yeah. That's Microsoft for ya' xD
@Mr.Lucifer; Like it says, my first appempt. I couldn't be arsed with all that stuff.
Just so everyone knows, I'm working on a messenging service with mySQL database and actual chat functions, so hopefully I'll get it working. =]
Re: First attempt at login system.
Quote:
Originally Posted by
patrickisit
@Mr.Lucifer; Like it says, my first appempt. I couldn't be bother with all that stuff.
That's not something you have to bother with, it's something you do.
Re: First attempt at login system.
Quote:
Originally Posted by
Mr.Lucifer
That's not something you have to bother with, it's something you do.
Exactly, otherwise you keep doing it, start with it and keep doing it.
Re: First attempt at login system.
Fair enough then.
I will make sure I do that with my messenging system, for all forms.
Re: First attempt at login system.
@ patricksit ; if it doesnt let you make it transparent when its over a picture box, then make the image the background for the main form and just dock it to the top, it will look the same and wont require any other objects on the form.
=) GL! btw lif u get that messenger going post it here i RLY wanna see it! :D
Re: First attempt at login system.
not that great, this is really basic, i presume your a begginer, so if u want to perfect this, do exactly the same thing but in client + server application :)
The client connects to server.
Basically after you do that part, then you should know what to do next ;)
Re: First attempt at login system.
It's cool, but personally, I like mine better, slightly more advanced, but I would still call mine basic.. It stores the usernames and passwords remotely, so users dont update when there is a new user, it is just http://mysite.com/license?username=a...sword=anything lol, so simple, I also coded a little admin thing, so i can block users, delete them ect