Hello,
I am trying to copy several files from sharepoint to local drive and i got some help on the code HERE.
I am using this code to copy several files:
When i run the code it tries to copy all the file one after another without waiting for the previous one to finish and i end up with all files being incomplete.
What can i do to make the code wait for one file to finish downloading and then start the next one?
I tried several ways but apparently i know too little of .net and i cannot get it work.
Thank you for your support.
Danut
I am trying to copy several files from sharepoint to local drive and i got some help on the code HERE.
I am using this code to copy several files:
vb.net Code:
Dim credentials As System.Net.NetworkCredential = System.Net.CredentialCache.DefaultNetworkCredentials Dim countries(0 To 4) As String countries(0) = "AE" countries(1) = "AN" countries(2) = "AT" countries(3) = "BA" countries(4) = "JO" For index = 0 To countries.Length - 1 Dim source As New Uri("http://prime.sharepoint.sss.com/folderreport/" & "filecountry_" & countries(index) & "_Prices.zip") Dim destination As String = "\\222.222.111.111\Testing_1\" & "filecountry_" & countries(index) & "_Prices.zip" 'My.Computer.Network.DownloadFile(source, destination, credentials, True, , False) My.Computer.Network.DownloadFile(source, destination, credentials, True, 60000I, False) Next
When i run the code it tries to copy all the file one after another without waiting for the previous one to finish and i end up with all files being incomplete.
What can i do to make the code wait for one file to finish downloading and then start the next one?
I tried several ways but apparently i know too little of .net and i cannot get it work.
Thank you for your support.
Danut