Start 2025 on time and up to date. Seamlessly integrate your calendars into Dropbox with these simple steps.

Forum Discussion

Coffeecat's avatar
Coffeecat
Helpful | Level 6
7 years ago

Alternative Async Await for DropboxClient.Files.DownloadAsync

I just started using the Dropbox API and so far I've manage to browse the files list through my code. Unfortunately, the DownloadAsync function provided by Dropbox's tutorial uses Async/Await, which is not available in VS 2010 (what I'm using).

I downloaded and installed Async CTP, it required VS SP1.
I downloaded and installed VS10SP1-KB2736182, it says it does not apply, or is blocked by another condition on your computer. Googled it but got no help I could understand.

Is there another way to implement this code segment without using Async/Await?

Async Sub DownloadFile(Filepath As String)
    Dim DF = Await DropboxClient.Files.DownloadAsync(Path.GetFileName(FilePath))
File.WriteAllBytes("file.txt", Await DF.GetContentAsByteArrayAsync) End Sub

I've tried reading other threads but they were in C# and Java, I don't have the ability to properly convert them.