[英]In C# Get All the .nsf files(Notes Database) from \data\notes directory and populate it in a Listbox
在C#中,從\\ data \\ notes目錄中獲取所有.nsf文件(Notes數據庫),並將其填充到列表框或組合框或樹視圖中。 我正在使用“ Interop.Domino.dll”。
您可以獲取目錄對象,然后以dos掩碼的形式從數組中請求文件。
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));
}
如果要從Domino服務器以外的任何地方運行應用程序,則可以使用Notes類訪問服務器並遍歷所有數據庫。 基本結構如下:
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);
...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.