returning list of documents

Mar 14, 2008 at 12:06 AM
Would you be willing to provide an example (in c#) of listing all documents for the user that is currently logged in? I've played around with variants of the following, but cannot seem to figure it out:

Scribd.Net.User.Documents

Thank you very much.
Coordinator
Mar 14, 2008 at 12:25 PM
Sure:

public void ListAllDocuments() 
{
     // Set up keys (this only needs to be done once.)
     Scribd.Net.Service.APIKey = "MyAPIKey";
     Scribd.Net.Service.SecretKey = "MySecretKey";
     Scribd.Net.Service.EnforceSigning = true;
 
     // You must be signed in ...
     if(Scribd.Net.User.Login("MyScribdUserName", "MyScribdPassword"))
     {
          // The logged in user instance is located at Scribd.Net.Service.User, so that is where you 
          // retrieve all the currently logged-in user's documents and settings.
          
          // Iterate over the Service.User.Documents.  This will retrieve the documents from the server.
          // If you upload more documents, you must call Service.User.ReloadDocuments()
          foreach(Scribd.Net.Document _document in Scribd.Net.Service.User.Documents)
          {
               Console.WriteLine(_document.Title);
          }
     }
}