查看Lotus Notes文档和项目从NSF文件用C# [英] Read Lotus Notes documents and items from NSF file with C#

查看:840
本文介绍了查看Lotus Notes文档和项目从NSF文件用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能得到所有的Lotus Notes从的Lotus Notes 的收件箱中的文件(如电子邮件和他们的内容)从 NSF 文件与C#和用法 interop.domino.dll

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?

我怎么能提取附件?

时的NotesSQL ODBC驱动程序一个很好的替代COM API?

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

推荐答案

这应该工作。 LotusScript内GetItemValue方法返回一个值数组,但通常你只是将需要第一个索引处的值。我不知道,如果它的工作原理相同的方式与COM,但调试器可以帮助你明白这一点。

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.

此外,如果你正在处理大量的文件,它的速度要快得多使用GetFirstDocument / GetNextDocument方法比它是使用GetNthDocument方法迭代。

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);
}

这篇关于查看Lotus Notes文档和项目从NSF文件用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆