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".
In C# Get All the .nsf files(Notes Database) from \data\notes directory and populate it in a Listbox
Asked
Active
Viewed 3,213 times
0
-
and that is a real question how? – Mitch Wheat Aug 06 '09 at 12:21
-
the question needs a bit of editing to be viable, but I've provided my answer assuming I understand the premise, without giving you an sln that you can just use. – DevelopingChris Aug 06 '09 at 12:23
-
Duplicate from same user: http://stackoverflow.com/questions/1238276/reading-lotus-notes-domino-mailboxe-using-interop-domino-dll-c – Steve Guidi Aug 06 '09 at 14:34
2 Answers
1
You could get a directory object and then ask for files by a dos mask from it as an array.
Using System.IO
var di = new DirectoryInfo("\data\notes");
FileInfo[] files = di.GetFiles("*.nsf");
DropDownList ddl = new DropDownList();
for(int i = 0;i<files.Length;i++)
{
var file = files[i];
ddl.Items.Add(ListItem.FromString(file.Name));
}

DevelopingChris
- 39,797
- 30
- 87
- 118
-
He said `ListBox`, `ComboBox`, or `TreeView`, which leads me to believe that he's talking about WinForms, not WebForms. – Adam Robinson Aug 06 '09 at 12:23
-
feel free to edit it, I think any list control expresses the point. – DevelopingChris Aug 06 '09 at 12:25
0
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);
...

Ed Schembor
- 8,090
- 8
- 31
- 37