|
-
Jul 26th, 2013, 05:26 PM
#2
Thread Starter
Addicted Member
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|