C#에서 data notes 디렉토리에서 모든 .NSF 파일 (Notes Database)을 가져 와서 Listbox에 채우십시오.
-
11-09-2019 - |
문제
C#에서 data notes 디렉토리에서 모든 .NSF 파일 (Notes Database)을 가져 와서 ListBox 또는 Combo Box 또는 Tree View에 채 웁니다. "interop.domino.dll"을 사용하고 있습니다.
해결책
Domino 서버 이외의 다른 곳에서 앱을 실행하는 경우 메모 클래스를 사용하여 서버에 액세스하고 모든 데이터베이스를 통해 루프 할 수 있습니다. 기본 구조는 다음과 같습니다.
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);
...
다른 팁
디렉토리 객체를 얻은 다음 배열로 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));
}
제휴하지 않습니다 StackOverflow