Progress bar when using Dropbox api

Using Dropnet (dropbox api). I can upload the file as follows:

DropNet.DropNetClient dc = new DropNet.DropNetClient("*************", "g86p9959v9tvg49"); dc.Login(" jain@gmail.com ", "********"); byte[] rawData = File.ReadAllBytes("Ionic.Zip.dll"); dc.UploadFile("Public", "Ionic.Zip.dll",rawData ); Console.WriteLine(dc.Account_Info().quota_info.quota/(1024*1024)); 

Is there a way to have a progress bar with this? It says here:

You can work out something yourself - you know how big the files are; you know how much you sent or received so far, the rest are basic math :)

How do I know how much data has been sent? any help please?

thanks

Edit: The download method returns - DropNet.Models.DropNetResult.statuscode object System.net.httpstatuscode. This is true? Should I somehow use this thing to make a progress bar?

+4
source share
1 answer

I don’t think you can see their source code on git-hub, since there is no feedback, which is always the case. There is UploadFileAsync () that takes the same parameters as UploadFile() , in addition to the reverse action that caused the termination. You can use the asynchronous method to show the marquee style progress indicator and clear the callback action.

I'm not sure if this will work, but you can grab quota_info before downloading and start downloading async and periodically monitor quota_info. If quota_info is updated as the file loads, then you know the file size and how much it was downloaded, and you should be able to do the math.

0
source

Source: https://habr.com/ru/post/1342628/


All Articles