与filezilla相比,以下代码速度极慢(代码上传速度约为100 kbps,filezilla速度为28 Mbps)
Private Sub UploadFTP(ByVal Datei As String, ByVal Dateiname As String, ByVal Ftp As String, ByVal Benutzername As String, ByVal Passwort As String)
Try
' WebClient
ftpUpload = New Net.WebClient
' URL mit Zieldatei
Dim url As String = Ftp & IIf(Ftp.EndsWith("/"), "", "/") & Dateiname
' Anmeldedaten am FTP-Server
ftpUpload.Credentials = New Net.NetworkCredential(Benutzername, Passwort)
' Datei asnychron uploaden
ftpUpload.UploadFileAsync(New Uri(url), Datei)
Catch ex As Exception
TextBox1.Text = TextBox1.Text & ex.ToString & vbNewLine
End Try
End Sub
经过几个小时的googeling后,我无法找到任何指向正确方向的东西。为什么上传这么慢,我怎么能增加呢?
修改
我认为这是一个缓冲问题。但没有找到增加缓冲区的方法。
感谢