I need to upload multiple files in a winforms application. So far I've been using a webclient and while this is working fine I'm wondering if there is a better way for doing this. Does the webclient make a new connection for every request or does the connection persists between uploads?
Dim Ftpclient As New System.Net.WebClient()
Ftpclient.Credentials = New System.Net.NetworkCredential(username, password)
Dim Files As New Dictionary(Of String, String)
''//Fill dictionary with items for upload here
For Each RemoteFile As String In Files.Keys
Ftpclient.UploadFile(RemoteFile, Files(RemoteFile))
Next