0

I know I can get the list of file in SkyDrive root by using liveClient.GetAsync("me/skydrive/files") and if I know the folder ID I can use liveClient.GetAsync(folderId + "/files"), so I don't want these as answers :)

Is there an easy way to get the list of files in a specific folder other that going through all user's folders and 3-levels deep to get the files inside "folderX/folderY/folderZ"?

TheBlueSky
  • 5,526
  • 7
  • 35
  • 65

1 Answers1

0

I think this code will help you.

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;
            }
        }
    }
}
Kishan_KP
  • 4,488
  • 6
  • 27
  • 46
Pooja Joshi
  • 23
  • 2
  • 6