我正在尝试LiveConnectClient.BackgroundUploadAsync
在 wp8 中使用,以上传一些数据的副本。
她是我的代码:
var progress = new Progress<LiveOperationProgress>();
progress.ProgressChanged += progress_ProgressChanged;
try
{
LiveOperationResult res =
await liveClient.BackgroundUploadAsync(folderID,
new Uri(@"\shared\transfers\" + backupFile.Name, UriKind.Relative),
OverwriteOption.Overwrite, new System.Threading.CancellationTokenSource().Token, progress);
dynamic result = res.Result;
fileID = result.id;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
progress.ProgressChanged -= progress_ProgressChanged;
}
它在模拟器上工作正常,但是当我在手机上尝试它时,它只有在手机通过 USB 连接到电脑时才工作,手机连接到 wifi。