files names in a folder off a server
I commonly use the following code to download a specific file off a server.
My.Computer.Network.DownloadFile _
("http://www.xxx.com/mlm_buyers/new_download_log.txt", "C:\xxx\mlm_buyer_followup\new_mlm_buyers_download_log.txt", "", "", True, 1000, True)
How do I retrieve all the files names in a folder off a server?
Re: files names in a folder off a server
I use this code to logon and upload files to my server.
Public Function ftp_file(ByRef username As String, ByRef password As String, ByRef server_file As String, ByRef local_path_file As String)
Try
Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create(server_file), System.Net.FtpWebRequest)
request.Credentials = New System.Net.NetworkCredential(username, password)
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim file() As Byte = System.IO.File.ReadAllBytes(local_path_file)
Dim strz As System.IO.Stream = request.GetRequestStream()
strz.Write(file, 0, file.Length)
strz.Close()
strz.Dispose()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function