Search code examples
c#lotus-dominointerop-domino

In C# Get All the .nsf files(Notes Database) from \data\notes directory and populate it in a Listbox


In C# Get All the .nsf files(Notes Database) from \data\notes directory and populate it in a Listbox or combo box or in Tree View. I am using "Interop.Domino.dll".


Solution

  • If you are running your app from anywhere other than the Domino server, you can use the Notes classes to access the server and loop over all databases. Here is the basic structure:

    NotesSession s = new Domino.NotesSessionClass();
    s.Initialize("MyPassword");
    NotesDbDirectory d = s.GetDbDirectory ("MyServer");
    NotesDatabase db = d.GetFirstDatabase();
    ...
    
    // loop over all DB's
    String sPath = db.filePath;
    ...
    db = d.getNextDatabase (db);
    ...