我正在創(chuàng)建一個(gè) UWP 應(yīng)用程序,我想使用 Onedrive API,以便用戶(hù)可以在其 Onedrive 帳戶(hù)中保存文件的副本,但我不明白,到目前為止我只成功登錄了我想要的內(nèi)容:上傳文件下載文件如果其中任何一個(gè)被修改,則進(jìn)行同步創(chuàng)建文件夾刪除文件此代碼實(shí)現(xiàn)了登錄,但我無(wú)法超越此,就像繼續(xù)上傳文件或下載文件一樣 private async void btn_Login_Click(object sender, RoutedEventArgs e) { if (this.oneDriveClient == null) { try { // Setting up the client here, passing in our Client Id, Return Url, // Scopes that we want permission to, and building a Web Broker to // go do our authentication. this.oneDriveClient = await OneDriveClient.GetAuthenticatedMicrosoftAccountClient( clientId, returnUrl, scopes, webAuthenticationUi: new WebAuthenticationBrokerWebAuthenticationUi()); // Show in text box that we are connected. txtBox_Response.Text = "We are now connected"; // We are either just autheticated and connected or we already connected, // either way we need the drive button now. btn_GetDriveId.Visibility = Visibility.Visible; }我在 github 中創(chuàng)建了一個(gè)示例存儲(chǔ)庫(kù):Onedrive Sync Files Sample我已經(jīng)嘗試過(guò)使用 Dropbox、Gdrive,但它在 UWP 上的實(shí)現(xiàn)似乎要復(fù)雜得多,所以我選擇了 OneDrive。任何答案都會(huì)非常有幫助,提前致謝
UWP - 如何在 C# 中使用 OneDrive API 同步文件
蠱毒傳說(shuō)
2024-01-20 21:04:26