查看Lotus Notes文档和项目从NSF文件用C#文档、文件、项目、Lotus

由网友(莂蜩戱莪丶尒杺莪悱礼沵)分享简介:我怎样才能得到所有的Lotus Notes从的Lotus Notes 的收件箱中的文件(如电子邮件和他们的内容)从 NSF 文件与C#和用法 interop.domino.dll How can I get all Lotus Notes documents (e.g. mails and their conten...

我怎样才能得到所有的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);
}
阅读全文

相关推荐

最新文章