Hi
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".
Hi
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".
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));
}
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);
...