当app退出时,如何将文件上传到skydrive? [英] How to upload file to skydrive when app exiting?

查看:95
本文介绍了当app退出时,如何将文件上传到skydrive?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在应用关闭时将文件上传到skydrive,所以我使用了Application_Closing()或MainPage的Back(),但它们无效。

I want to upload file to skydrive when app closing, so I use Application_Closing() or MainPage's Back(),but they are not work.

  LiveOperationResult res2 = await client.BackgroundUploadAsync(skyDriveFolderID,new Uri(" /shared/transfers/SkyCodeCase1.sdf" ;,UriKind.Relative),OverwriteOption.Overwrite);

 LiveOperationResult res2 = await client.BackgroundUploadAsync(skyDriveFolderID, new Uri("/shared/transfers/SkyCodeCase1.sdf", UriKind.Relative), OverwriteOption.Overwrite);

不起作用。

UploadAsync(,,)不起作用。

UploadAsync(,,) not works.

是否存在对角错误?

推荐答案

根据文档,Windows Phone不支持此API:
http://msdn.microsoft.com/en-us/library/live/jj219362.aspx


According to the documentation this API is not supported for windows phone: http://msdn.microsoft.com/en-us/library/live/jj219362.aspx

此外,如果您找到另一种方法,我建议不要在App Closing期间进行云上传。我相信在系统终止您的流程之前,您只需在应用程序关闭期间停留十秒钟。也许您可以将文件保存到隔离存储,
然后在下次应用程序运行时将其上传到SkyDrive。

Also if you find another method of doing this I'd suggest against doing a cloud upload during App Closing. I believe you only have ten seconds during App Closing before the system kills your process. Maybe instead you could save the file to isolated storage, then upload it to SkyDrive the next time the app runs.


这篇关于当app退出时,如何将文件上传到skydrive?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆