简体   繁体   中英

Google Apps feed Google API

I am uploading data to Google apps programmatically. I am using the following code

MailItemEntry[] entries = new MailItemEntry[1];
entries[0] = new MailItemEntry();
entries[0].BatchData = new Google.GData.Client.GDataBatchEntryData();
MailItemFeed feed = mailItemService.Batch(domain, UserName, entries);

Is there any way to find out how much data(in MB or GB) has been uploaded to google apps. Thanks in advance.

What you can do it utilize the BatchAsync of the mailItemService and hook up to the AsyncOperationProgress event. This will tell you, as a percent, how much of the data has been sent. Just be aware that BatchAsync is a non blocking call, so your application will need to change as a result.

If you have access to the length of the data that you are sending, you can calculate how much has gone up with each progress changed event.

See Google-docs http://google-gdata.googlecode.com/svn-history/r902/docs/folder4/AllMembers_T_Google_GData_Apps_Migration_MailItemService.htm

MSDN http://msdn.microsoft.com/en-us/library/system.componentmodel.progresschangedeventargs.aspx

Hope that helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM