Page 1 of 4

Make your own FTP Chat

Posted: Sat May 15, 2010 5:42 pm
by RunarM
This tutorial is on how to make a FTP chat.
-viewtopic.php?f=35&t=1912

What you will need:
*2 Forms [Start and Main]

Main:
*1 Textbox
*1 Button
*2 RichTextboxes
*1 Timer
Untitled.png
Start:
*1 Textbox
*1 Button

-----------------------------

Start: Textbox1 Code:
Your username have to be more then 3 letters =)
Code: Select all
If TextBox1.TextLength = 3 Then
            Button1.Enabled = True
        End If
Start: Button1 Code:
-This will hide the form and show the main form
Code: Select all
 Me.Hide()
       Main.Show()


MAIN: Button1:
Code: Select all
        Dim name As String
        name = TextBox1.Text
        Try
            Dim client As New Net.WebClient
            client.Credentials = New Net.NetworkCredential("FTP USERNAME", "FTP PASSWORD")
            client.UploadString("ftp://YOURWEBSITE.com/chat.txt", "[" & TimeOfDay & "] " & Start.TextBox1.Text & ": " & TextBox1.Text & vbNewLine & RichTextBox2.Text & vbNewLine)
            RichTextBox2.Clear()
        Catch ex As Exception
            MsgBox("Error, this error is being taken care of.", MsgBoxStyle.Critical, "Error!")
        End Try
        Try
            Dim client As New Net.WebClient
            client.Credentials = New Net.NetworkCredential("FTP USERNAME", "FTP PASSWORD")
            RichTextBox2.Text = client.DownloadString("ftp://YOURWEBSITE.com/chat.txt")
            If RichTextBox2.Text = RichTextBox1.Text Then  Else  : RichTextBox1.Text = RichTextBox2.Text

        Catch ex As Exception
        End Try
        TextBox1.Text = ""
MAIN Timer1 code:
Code: Select all
        Try
            Dim client As New Net.WebClient
            client.Credentials = New Net.NetworkCredential("FTP USERNAME", "FTP PASSWORD")
            RichTextBox2.Text = client.DownloadString("ftp://YOURWEBSITE.com/chat.txt")
            If RichTextBox2.Text = RichTextBox1.Text Then  Else  : RichTextBox1.Text = RichTextBox2.Text
        Catch ex As Exception
        End Try
    End Sub
Timer Interval: 5000
Timer Enabled = True

You have to edit the places with 'FTP USERNAME', 'FTP PASSWORD' and 'YOURWEBSITE.com'

Hope you understood the tutorial.

RunarM
Source: http://www.runarmolund.com/WRONG.zip

Re: Make your own FTP Chat

Posted: Sat May 15, 2010 6:23 pm
by Martin
thanks

Re: Make your own FTP Chat

Posted: Sat May 15, 2010 8:08 pm
by RunarM
How to get FTP Server for free:

1. Go to this website:http://www.000webhost.com/order.php
2. Fill out the form
1.png
3. Browse down till you see this:
2.png
Congratulation, now you have a FTP Server thingy =)

Re: Make your own FTP Chat

Posted: Sun May 16, 2010 2:41 am
by zachman61
i made a video for this and put on here a few months ago

Re: Make your own FTP Chat

Posted: Sun May 16, 2010 2:59 am
by RunarM
If you look at the top of the tutorial there is a link to your thread.. Easier as a tutorial =)

Re: Make your own FTP Chat

Posted: Sun May 16, 2010 3:09 am
by zachman61
very sorry to sound mean if i did
i typed link in wrong lol i deleted the 2 at the end

Re: Make your own FTP Chat

Posted: Sun May 16, 2010 3:16 am
by RunarM
You didn't sound mean :O

Re: Make your own FTP Chat

Posted: Sun May 16, 2010 3:52 am
by zachman61
it now works on vista/7

Re: Make your own FTP Chat

Posted: Mon May 17, 2010 2:27 pm
by RunarM
I've edited some stuff =)

So you don't have to click button1 all the time:
Code: Select all
   Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            Button1.PerformClick()
        End If
    End Sub

Re: Make your own FTP Chat

Posted: Mon May 17, 2010 6:59 pm
by zachman61
i used accept button instead