Make your own FTP Chat
Posted: Sat May 15, 2010 5:42 pm
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 Start:
*1 Textbox
*1 Button
-----------------------------
Start: Textbox1 Code:
Your username have to be more then 3 letters =)
-This will hide the form and show the main form
MAIN: Button1:
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
-viewtopic.php?f=35&t=1912
What you will need:
*2 Forms [Start and Main]
Main:
*1 Textbox
*1 Button
*2 RichTextboxes
*1 Timer Start:
*1 Textbox
*1 Button
-----------------------------
Start: Textbox1 Code:
Your username have to be more then 3 letters =)
Code: Select all
Start: Button1 Code: If TextBox1.TextLength = 3 Then
Button1.Enabled = True
End If
-This will hide the form and show the main form
Code: Select all
Me.Hide()
Main.Show()
MAIN: Button1:
Code: Select all
MAIN Timer1 code:
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 = ""
Code: Select all
Timer Interval: 5000 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 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