使用 Xamarin.Forms,我在 UWP 上使用 OneDrive SDK 来访问 OneDrive,它运行良好。我正在上传/下载小数据文件,并使用以下代码更改文件的 LastModifiedDate:
Item itemUpdate1 = new Item();
itemUpdate1.FileSystemInfo = new Microsoft.OneDrive.Sdk.FileSystemInfo {LastModifiedDateTime = lastModifiedDateTime };
await oneDriveClient1.Drive.Items[item1.Id].Request().UpdateAsync(itemUpdate1);
在 Android 上,我使用 Xamarin.Auth 访问 OneDrive,但我不知道如何更新文件的 LastModifiedDate。我正在使用以下代码登录并上传文件:
var auth = new OAuth2Authenticator(clientId: clientId, scope: storageScopes1, authorizeUrl: new System.Uri("https://login.live.com/oauth20_authorize.srf"),
redirectUrl: new System.Uri("https://login.live.com/oauth20_desktop.srf"));
System.Uri dataFileUri = new System.Uri("https://api.onedrive.com/v1.0/drive/special/approot:/" + dataFileName1 + ":/content");
var requestUpload = new OAuth2Request("PUT", dataFileUri, null, account);
我想知道是否可以使用 OAuth2Request 更新文件的 LastModifiedDate 或者是否有其他方法可以做到这一点?谢谢你的帮助。