請照下面作法設定開發環境的機器:

1. 安裝 Notes Client (我用的是 Domino Client 6.5)
2. 開 VS.Net 2003 Command line, 執行 tlbimp domobj.tlb (在 C:\Program Files\lotus\notes\), 這會把 domobj.tlb 轉為 Domino.dll (可被 .NET Reference)
3. 執行 regsvr32 “C:\Program Files\lotus\notes\nlsxbe.dll” 註冊這支 DLL (必要)
4. 程式中 Reference 剛剛產生的 Domino.dll,接著就可以 using Domino 並用:
[csharp]static void Main(string[] args)
{
string NotesPassword = “P@ssword”;
string NotesHost = “domino/admin/01”;
Console.Write (“SERVER [(domino/admin/01)] : “);
NotesHost = Console.ReadLine();
Console.Write (“PASSWORD: “);
NotesPassword = Console.ReadLine();
Say (“Try login to server, please wait…”);

Domino.NotesSession ns = new NotesSession();
ns.Initialize (NotesPassword);
Say (“Sesstion Initialized!”);
Domino.NotesDatabase ndb = ns.GetDatabase (NotesHost, @”mynotesdb.NSF”, true);
Say (“Connected to DB: ” + ndb.Title);
DisplayDocuments (ndb);
Say (“Program terminated, press any key…”);
Console.Read();
}

// ——————————————————————–
static public void DisplayDocuments(Domino.NotesDatabase ndb)
{
Domino.NotesDocumentCollection ndc = ndb.AllDocuments;
// LOOP DB DOCUMENTS
for (int i=1;i

最後修改日期: 2006-05-29