sorry maar het is niet echt iets wat ik zoek... wie weet wat er allemaal mis kan gaan met een dll van iemand anders waarvan je de bron niet van kan zien.
ik heb een code gevonden om te downloaden nadeel is dat ik nog niet weet hoe ik hem kan omzeten naar upload
iemand een suggestie ?
'EXAMPLE OF HOW TO USE FtpWebRequest
'Values to use
'Const localFile As String = "C:\file.bin"
'Const remoteFile As String = "/ftpfile.bin"
'Const host As String = "ftp://ftp.myserver.com"
'Const username As String = "myusername"
'Const password As String = "mypassword"
'Create a request
Dim URI As String = host & remoteFile
Dim ftp As System.Net.FtpWebRequest = CType(System.Net.FtpWebRequest.Create(URI), System.Net.FtpWebRequest)
'Set the credentials
ftp.Credentials = New System.Net.NetworkCredential(username, password)
'Turn off KeepAlive (will close connection on completion)
ftp.KeepAlive = False
'we want a binary
ftp.UseBinary = True
'Define the action required (in this case, download a file)
ftp.Method = System.Net.WebRequestMethods.Ftp.DownloadFile
'If we were using a method that uploads data e.g. UploadFile
'we would open the ftp.GetRequestStream here an send the data
'Get the response to the Ftp request and the associated stream
Using response As System.Net.FtpWebResponse = CType(ftp.GetResponse, System.Net.FtpWebResponse)
Using responseStream As IO.Stream = response.GetResponseStream
'loop to read & write to file
Using fs As New IO.FileStream(localFile, IO.FileMode.Create)
Dim buffer(2047) As Byte
Dim read As Integer = 0
Do
read = responseStream.Read(buffer, 0, buffer.Length)
fs.Write(buffer, 0, read)
Loop Until read = 0 'see Note(1)
responseStream.Close()
fs.Flush()
fs.Close()
End Using
responseStream.Close()
End Using
response.Close()
End Using