WebClient1.DownloadFileAsync(New Uri("http://mysite/chat.txt"), "chat.txt")
Private Sub WebClient1_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient1.DownloadFileCompleted
Dim read As String = My.Computer.FileSystem.ReadAllText("ragenews.txt")
TextBox3.Text = "" & read & ""
End Sub
My.Computer.Network.UploadFile(FileLocation, FTPlocation, FTPUsername, FTPPassword, False, 1000000, True)
My.Computer.Network.DownloadFile(FTPLocation, DownloadLocation, FTPUsername, FTPPassword, False, 1000000, True)
My.Computer.Network.UploadFile("C:\test.txt", "ftp:/www.tes*****m/testfile.txt", "username", "password", False, 1000000, True)
ftp.mysite.com/chat.txt is not a valid remote file address. A valid address should include a protocol, a path and a file name. Parameter name: address
Private Sub WebClient2_DownloadFileCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient2.DownloadFileCompleted
Dim read As String = My.Computer.FileSystem.ReadAllText("chat.txt")
TextBox4.Text = "" & read & ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim FILE_NAME As String = "My.Computer.FileSystem.CurrentDirectory\chat.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox4.Text)
objWriter.Close()
End If
'@@@@@@@@@@@@@@@@@@@-------------------------------------------------------------------------@@@@@@@@@
My.Computer.Network.UploadFile("My.Computer.FileSystem.CurrentDirectory\chat.txt", "ftp.mysite.com/chat.txt", "chat@mysite.com", "pass", False, 1000000, True)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim FILE_NAME As String = "c:\chat.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write(TextBox4.Text)
objWriter.Close()
End If
'@@@@@@@@@@@@@@@@@@@-------------------------------------------------------------------------@@@@@@@@@
My.Computer.Network.UploadFile("c:\chat.txt", "ftp://mysite.com/chat.txt", "chat@mysite.com", "pass", False, 1000000, True)
End Sub