Make your own FTP Chat

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
33 posts Page 3 of 4
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

Re: Make your own FTP Chat
Napster1488
When you´re German then go to www.funpic.de there u can create Website which also includes a FTP.
When registering at www.uploaded.to then u can also upload files to account trough ftp maybe u can use that too....
YouTube Downloader v3.0
Image
Image
Image
User avatar
volttide
VIP - Donator
VIP - Donator
Posts: 106
Joined: Mon Jan 17, 2011 8:24 am

Re: Make your own FTP Chat
volttide
I make a LAN chat download here
LAN Chat.zip
You do not have the required permissions to view the files attached to this post.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Make your own FTP Chat
mandai
Is there any FTP support in that app?
User avatar
BlakPilar
New Member
New Member
Posts: 15
Joined: Fri Apr 08, 2011 7:49 pm

Re: Make your own FTP Chat
BlakPilar
Just to point it out, as I see many people doing this for no reason at all, you can do
Code: Select all
If RichTextBox2.Text <> RichTextBox1.Text Then  RichTextBox1.Text = RichTextBox2.Text
instead of
Code: Select all
If RichTextBox2.Text = RichTextBox1.Text Then  Else  : RichTextBox1.Text = RichTextBox2.Text
EDIT: It's good programming practice to rename your controls so they're not something like "RichTextBox1".
Image
User avatar
rocky4126
VIP - Donator
VIP - Donator
Posts: 258
Joined: Mon Nov 16, 2009 7:39 pm

Re: Make your own FTP Chat
rocky4126
btw, 000webhost aren't advisable for stuff like this, I've been with them for a while, they caused alot of issues. Instead, http://x10hosting.com is good, their servers got new hardware recently too increasing performance, I've used em for a while now and they've not let me down.
Image
User avatar
JustFashion
New Member
New Member
Posts: 14
Joined: Sat Nov 27, 2010 3:28 pm

Re: Make your own FTP Chat
JustFashion
Hello,
can u help me how can i make commands?
like irc /ban /kick /unban etc..
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Make your own FTP Chat
mandai
You could make a script that lets the FTP server follow those commands.
User avatar
rocky4126
VIP - Donator
VIP - Donator
Posts: 258
Joined: Mon Nov 16, 2009 7:39 pm

Re: Make your own FTP Chat
rocky4126
@justfashion:
Code: Select all
    Dim client As New Net.WebClient
    Dim iscommand As New Boolean
    Dim name1 As New String(My.Settings.nick)
    Dim privs As String
    Dim kick As String
    Dim clear As String
    Dim admin As String
    Dim subrank As String
    Dim rank As System.Drawing.Color
    Public Sub checkcommands(ByVal input As System.String)
        If (input.StartsWith("/")) Then
            iscommand = True
        Else
            iscommand = False
        End If
    End Sub
    Public Sub processcommand(ByVal command As System.String)
        If command.StartsWith("/nick") Then
            Dim oldname As String
            oldname = name1
            My.Settings.nick = command.Substring(6)
            name1 = My.Settings.nick
            Dim users As String
            client.Credentials = New Net.NetworkCredential("root", "***")
            users = client.DownloadString("ftp://127.0.0.1/server.users")
            users = users.Replace(oldname, name1)
            client.UploadString("ftp://127.0.0.1/server.users", users)
            getprivs(name1)
        End If
        If command = "/cls" And clear = "1" Then
            client.Credentials = New Net.NetworkCredential("root", "***")
            client.UploadString("ftp://127.0.0.1/server.messages", name1 + " Cleared the chat log")
            MsgBox("DONE!")
        ElseIf command = "/cls" And clear = "0" Then
            MsgBox("Your not permitted to do this! DEBUG INFO: Required Permission value: 1 | Your Value: " & clear)
        End If
        If command = "/sanick" And admin = "1" Then
            client.Credentials = New Net.NetworkCredential("root", "***")
            Dim oldname As String
            Dim newname As String
            Dim strarray As Array
            strarray = command.Split(" ")
            oldname = strarray.GetValue(0)
            newname = strarray.GetValue(1)
            Dim str As String
            str = client.DownloadString("ftp://127.0.0.1/server.users")
            str = str.Replace(oldname, newname)
            client.UploadString("ftp://127.0.0.1/server.users", str)
        End If
    End Sub
    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
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        name1 = My.Settings.nick
        checkcommands(TextBox1.Text)
        If iscommand = True Then
            processcommand(TextBox1.Text)
            TextBox1.Clear()
            Exit Sub
        End If
        Try
            client.Credentials = New Net.NetworkCredential("root", "***")
            client.UploadString("ftp://127.0.0.1/server.messages", "[" & TimeOfDay & "] " & name1 & ": " & 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
            client.Credentials = New Net.NetworkCredential("root", "***")
            RichTextBox2.Text = client.DownloadString("ftp://127.0.0.1/server.messages")
            If RichTextBox2.Text = RichTextBox1.Text Then  Else  : RichTextBox1.Text = RichTextBox2.Text

        Catch ex As Exception
        End Try
        TextBox1.Text = ""
    End Sub
    Sub getprivs(ByVal name As String)
        client.Credentials = New Net.NetworkCredential("root", "***")
        Dim one As String
        Dim onearray As Array
        one = client.DownloadString("ftp://127.0.0.1/server.privs")
        onearray = one.Split(" ")
        For Each one In onearray
            If one.StartsWith(name) Then
                Dim split As Array
                split = one.Split(",")
                kick = split.GetValue(1)
                clear = split.GetValue(2)
                admin = split.GetValue(3)
                subrank = split.GetValue(4)
                Select Case subrank
                    Case 1
                        rank = Color.Red
                    Case 2
                        rank = Color.Blue
                    Case 3
                        rank = Color.Green
                    Case Else
                        rank = Color.Black
                End Select
            End If
        Next

    End Sub
I've thrown a bit of my code in there, hope it helps. goto the sub: processcommands and add the /kick etc in there. I'm still working on that part, but the fact that I'm making it into a server + client app takes priority. I'm also using Multi-Threaded FTP connections if anyone wants to know how to stop the error where it seems to crash when trying to connect (It claims the client is not logged in according to FileZilla)
Image
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Re: Make your own FTP Chat
Bogoh67
instead of using a hidden rtb can i also use a public string or does it have to be rtf styled
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

Re: Make your own FTP Chat
smashapps
You could use a public string, or even a setting I'm sure it would work fine
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
33 posts Page 3 of 4
Return to “Tutorials”