Results 1 to 6 of 6

Thread: My chat program, someone HELP! PLEASE =)

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Exclamation

    Alright, I made a chat program, and it requires a text file, thats on my friends FTP server...It appends to the file, and the file is read for the chat window...Heres the code:
    ------------------------------------------------------------------------
    Private Sub cmdSend_Click()
    '"sends" the message
    Dim FileNum As Integer
    FileNum = FreeFile
    Open "ftp://wp.dyndns.org/var/ftp/upload/murali/Chat.txt" For Append As FileNum
    If txtMsg.Text = "" Then
    lblErrormsg.Caption = "Insert a message before you hit send"
    Close #FileNum
    Else
    Print #FileNum, Login; " >>"; " "; txtMsg.Text
    txtMsg.Text = ""
    Close #FileNum
    End If
    End Sub
    ------------------------------------------------------------------------
    The open address is correct, when I type it in as a URL in a Web Browser, it works fine...Otherwise, won't work at all...Any suggestions?

  2. #2
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    I don't get what you mean?
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    2

    Oops

    What I mean is, it gives me a File Not Found error whenever I run the program. It specifically highlights that line of code. I can run the program when the chat.txt is on my desktop, and it'll run fine, sending the message and reading it, and all that...But, when I changed the local address to the FTP address shown, it gives me a File Not Found error, and terminates the program. What I would like to know is, whats the problem...is it a wrong address or do I have to add more coding to it?

  4. #4
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Notice that when you change the address i'm sure you need to disconnect (unless you mean change the address within the server)
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  5. #5
    Lively Member AndySoft's Avatar
    Join Date
    Oct 2000
    Location
    Massillon, OH
    Posts
    68

    Lightbulb Well...

    I don't think you can open an FTP address like a normal file... You have to download it, edit it, and upload it...
    -AndySoft
    [email protected]
    [email protected] (Use the other one first!)

    I use: NASM, HTML, Perl, PHP, JavaScript, Batch, TI-Basic (TI-83+), QBasic 1.1, QuickBASIC 4.5, QuickBASIC Extended 7.1, VB-WIN 6 Ent., and the rest of Visual Studio 6 Ent. And who knows what else!

  6. #6
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    Sorry, I didn't read though it all right. You can only use the Open statement with a file on your PC, not on interent.

    Try looking for a FTP control and use that to download it then upload it when changes are made.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width