cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Not happy with your Spotify Wrapped? Check out how Kevin on the Dropbox team used Paper to make sure he keeps discovering new music over here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Comments

Alternative Async Await for DropboxClient.Files.DownloadAsync

Alternative Async Await for DropboxClient.Files.DownloadAsync

Coffeecat
Helpful | Level 6

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.

2 Accepted Solutions

Accepted Solutions

Re: Alternative Async Await for DropboxClient.Files.DownloadAsync

Greg-DB
Dropboxer

[Cross-linking for reference: https://stackoverflow.com/questions/53445693/alternative-async-await-for-dropboxclient-files-downloa... ]

I see you also posted this on StackOverflow. The comment the user "GSerg" posted there is correct. If you can't or don't want to use the Async methods, you can use the Begin/End methods instead. 

View solution in original post

Re: Alternative Async Await for DropboxClient.Files.DownloadAsync

Coffeecat
Helpful | Level 6

Thanks @Greg-DB, I upgraded into VS 2017. I realized I could do more with it. Thanks!

View solution in original post

2 Replies 2

Re: Alternative Async Await for DropboxClient.Files.DownloadAsync

Greg-DB
Dropboxer

[Cross-linking for reference: https://stackoverflow.com/questions/53445693/alternative-async-await-for-dropboxclient-files-downloa... ]

I see you also posted this on StackOverflow. The comment the user "GSerg" posted there is correct. If you can't or don't want to use the Async methods, you can use the Begin/End methods instead. 

Re: Alternative Async Await for DropboxClient.Files.DownloadAsync

Coffeecat
Helpful | Level 6

Thanks @Greg-DB, I upgraded into VS 2017. I realized I could do more with it. Thanks!

Who's talking

Top contributors to this post

  • User avatar
    Coffeecat Helpful | Level 6
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?