-
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?
-
I don't get what you mean?
-
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?
-
Notice that when you change the address i'm sure you need to disconnect (unless you mean change the address within the server)
-
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...
-
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.