我知道我可以使用liveClient.GetAsync("me/skydrive/files")
获取SkyDrive根目录中的文件列表,如果我知道我可以使用liveClient.GetAsync(folderId + "/files")
的文件夹ID,那么我不希望这些作为答案:)< / p>
是否有一种简单的方法可以获取特定文件夹中的文件列表,这些文件夹通过所有用户的文件夹和3层深度来获取“folderX / folderY / folderZ”中的文件?
答案 0 :(得分:0)
我认为此代码可以帮助您。
private const string DropBoxUsername = "abc@hotmail.com";
private const string DropBoxPassword = "password";
private const string FolderName = "MainFolder";
private const string UserEmail = "abc@hotmail.com";
protected void BtnUploadClick(object sender, EventArgs e)
{
var client = new SkyDriveServiceClient();
// log on into drop box using username and password
client.LogOn(DropBoxUsername, DropBoxPassword);
// verifying the company folder is available or not
WebFolderInfo userskyDrivefolder = null;
WebFolderInfo clientskyDrivefolder =
client.ListRootWebFolders().FirstOrDefault(subWebFolder => subWebFolder.Name == FolderName);
if (clientskyDrivefolder != null)
{
foreach (WebFolderInfo subWebFolder in client.ListSubWebFolders(clientskyDrivefolder))
{
if (subWebFolder.Name == UserEmail)
{
userskyDrivefolder = subWebFolder;
break;
}
}
}
}