zoukankan      html  css  js  c++  java
  • 使用 VS.NET 開發 Lotus Notes Client Application 前置作業

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


    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 並用:

    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<ndc.Count;i++)

        {

            Domino.NotesDocument nd = ndc.GetNthDocument (i);

            foreach (object no in (object[]) nd.Items)

            {

                Domino.NotesItem ni = (Domino.NotesItem) no;

                Say (ni.Name + " (" + ni.type.ToString() + "): \t\t" + ni.Text);

            }

            Say ("========================================================");

        }

    }



    // --------------------------------------------------------------------

    static public void Say(string S)

    {

        Console.WriteLine (S);

    }




    這樣可以連得到 Domino Server...


    Tips:

    執行 ildasm Domino.dll 可以讓你看到裡頭有甚麼東西可以使用的....

  • 相关阅读:
    第194场周赛
    刷leetcode的心得
    91. Decode Ways
    23. Merge k Sorted Lists
    19. Remove Nth Node From End of List
    21. Merge Two Sorted Lists
    222. Count Complete Tree Nodes
    958. Check Completeness of a Binary Tree
    课程学习总结报告
    结合中断上下文切换和进程上下文切换分析Linux内核一般执行过程
  • 原文地址:https://www.cnblogs.com/jackzhang/p/602078.html
Copyright © 2011-2022 走看看