使用 C# 读取 NSF 文件中的 Lotus Notes 文档和项目

发布于 2024-10-04 08:41:08 字数 694 浏览 0 评论 0原文

如何使用 C# 和使用 interop.domino 从 NSF 文件中获取 Lotus Notes 收件箱中的所有 Lotus Notes 文档(例如邮件及其内容) .dll?

我想使用以下代码片段:

Domino.NotesSession m_session = null;

...

this.m_session = new Domino.NotesSession();
this.m_session.Initialize("");

Domino.NotesDatabase db = null;
this.m_session.GetDatabase("", "C:\test.nsf", false);

Domino.NotesDocumentCollection col = db.AllDocuments;

for (int i = 0; i < col.Count; ++i)
{
         Domino.NotesDocument doc = col.GetNthDocument(i);

         ...
}

如何访问每个文档的项目?例如,我想要主题、人物、日期、时间……

如何迭代文档的所有项目?

如何提取附件?

NotesSQL ODBC 驱动程序是 COM API 的良好替代品吗?

How can I get all Lotus Notes documents (e.g. mails and their content) from a Lotus Notes inbox from an NSF Files with C# and the usage of interop.domino.dll?

I want to use the following snippet:

Domino.NotesSession m_session = null;

...

this.m_session = new Domino.NotesSession();
this.m_session.Initialize("");

Domino.NotesDatabase db = null;
this.m_session.GetDatabase("", "C:\test.nsf", false);

Domino.NotesDocumentCollection col = db.AllDocuments;

for (int i = 0; i < col.Count; ++i)
{
         Domino.NotesDocument doc = col.GetNthDocument(i);

         ...
}

How can I access the items of each document? For example I want subject, who, date, time,...

How can I iterate throug all items of a document?

How can I extract attachments?

Is the NotesSQL ODBC driver a good alternative to the COM API?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难理解 2024-10-11 08:41:08

这应该有效。 Lotusscript 中的 GetItemValue 方法返回一个值数组,但通常您只需要第一个索引处的值。我不确定它与 COM 的工作方式是否相同,但调试器可以帮助您弄清楚这一点。

此外,如果您要处理大量文档,则使用 GetFirstDocument/GetNextDocument 方法进行迭代比使用 GetNthDocument 方法要快得多。

Domino.NotesDocument doc = col.GetFirstDocument(doc);
while (doc != null) {

     string subject = doc.GetItemValue("subject")[0];
     string who = doc.GetItemValue("sendto")[0];

     Domino.NotesDocument doc = col.GetNextDocument(doc);
}

This should work. The GetItemValue method in Lotusscript returns a value array, but usually you're just going to need the value at the first index. I'm not sure if it works the same way with COM, but the debugger can help you figure that out.

Also if you're processing a lot of documents it is much faster to iterate using the GetFirstDocument/GetNextDocument methods than it is to use the GetNthDocument method.

Domino.NotesDocument doc = col.GetFirstDocument(doc);
while (doc != null) {

     string subject = doc.GetItemValue("subject")[0];
     string who = doc.GetItemValue("sendto")[0];

     Domino.NotesDocument doc = col.GetNextDocument(doc);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文