xeloader Creator & Owner
Number of posts : 326 Age : 31 Programming Skill : Programming Languages : VB.net, Java [A little], HTML. Registration date : 2008-07-08
| Subject: [Xx] Local Chat System Wed Apr 15, 2009 9:59 pm | |
| Just something I made up xD I was bored up to 100% percent, and made a simple login chat system. It's up to you on how to use it, but this is how it looks: - Code:
-
Public Class Form1 Dim Sentmessage As String Dim User As String
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click If Button3.Text = "Login" Then MsgBox("You have to be logged in to chat!") Else User = TextBox3.Text Sentmessage = TextBox2.Text ListBox1.Items.Add(User + ": " + Sentmessage) TextBox2.Clear() End If End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If My.Computer.FileSystem.FileExists(".\Usernames\" + TextBox3.Text + ".txt") Then MsgBox("The Username " + TextBox3.Text + ", is already in use! Please choose another one!") Else My.Computer.FileSystem.CreateDirectory(".\Usernames\") My.Computer.FileSystem.WriteAllText(".\Usernames\" + TextBox3.Text + ".txt", TextBox3.Text, True) My.Computer.FileSystem.CreateDirectory(".\Passwords\") My.Computer.FileSystem.WriteAllText(".\Passwords\" + TextBox3.Text + ".txt", TextBox4.Text, True) End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If My.Computer.FileSystem.FileExists(".\Usernames\" + TextBox3.Text + ".txt") Then If My.Computer.FileSystem.ReadAllText(".\Passwords\" + TextBox3.Text + ".txt").Equals(TextBox4.Text) Then If Button3.Text = "Log Out" Then TextBox3.ReadOnly = False TextBox4.ReadOnly = False TextBox3.Clear() TextBox4.Clear() Button2.Visible = True Button3.Text = "Login" MsgBox("Welcome back later!") Else TextBox3.ReadOnly = True TextBox4.ReadOnly = True Button3.Text = "Log Out" Button2.Visible = False MsgBox("You are now logged in Mr " + TextBox3.Text + "!") End If End If Else MsgBox("The username or Password is incorrect, please try again!") End If End Sub End Class
And a printscreen on how my program looks: P.S The code isn't near one of the most compact, but it's working Thx //Xeloader | |
|
Reloader A ½ Programmer
Number of posts : 173 Age : 29 Programming Skill : Programming Languages : Learned new laguages: Visual C++ (you can make everything with this), Java & CSS/HTML. Registration date : 2009-01-02
| Subject: Re: [Xx] Local Chat System Wed Apr 15, 2009 11:05 pm | |
| Nice, I like it | |
|
what the he Servant
Number of posts : 1 Programming Skill : Programming Languages : what? Registration date : 2009-08-19
| Subject: Re: [Xx] Local Chat System Wed Aug 19, 2009 8:37 pm | |
| | |
|
Fpsdown Beginner
Number of posts : 18 Age : 27 Programming Skill : Programming Languages : ^^ Registration date : 2009-06-30
| Subject: Re: [Xx] Local Chat System Mon Aug 31, 2009 3:47 pm | |
| | |
|
Sponsored content
| Subject: Re: [Xx] Local Chat System | |
| |
|