如何在Windows手机中上传文件我的意思是哪些控件用于浏览文件(手机内容)是为Windows手机预定义的,还是我们需要手动创建。浏览它们并上传它们。
答案 0 :(得分:2)
您可以尝试MSDN方式
private async void Upload() { try { // Ensure that the user has consented to the wl.skydrive and wl.skydrive_update scopes. var authClient = new LiveAuthClient(); var authResult = await authClient.LoginAsync(new string[] { "wl.skydrive", "wl.skydrive_update" }); if (authResult.Session != null) { var liveConnectClient = new LiveConnectClient(authResult.Session); // Upload to OneDrive. LiveUploadOperation uploadOperation = await liveConnectClient.CreateBackgroundUploadAsync( uploadPath, fileName, uploadInputStream, OverwriteOption.Rename); LiveOperationResult uploadResult = await uploadOperation.StartAsync(); HandleUploadResult(uploadResult); } } catch (LiveAuthException ex) { // Handle errors. } catch(LiveConnectException ex) { // Handle errors. } } var pendingOperations = await LiveConnectClient.GetCurrentBackgroundUploadsAsync(); foreach(LiveDownloadOperation pendingOperation in pendingOperations) { try { var opResult = await pendingOperation.AttachAsync(); // Handle results. } catch { // Handle errors. } }