【发布时间】:2009-09-16 07:45:58
【问题描述】:
我正在尝试从“$File”(Lotus Notes)访问附件名称。
NotesView inbox = _serverDatabase.GetView("($Inbox)");
NotesDocument docInbox = inbox.GetFirstDocument();
NotesItem file = docInbox.GetFirstItem("$File");
String fileType = file.type.ToString();
(获取包含附件的邮件的文件类型值“附件”)
我没有得到解决方案:
How to Access attachments from Notes mail?
我得到了解决方案:
object[] items = (object[])docInbox.Items;
foreach (NotesItem nItem in items)
{
if (nItem.Name == "$FILE")
{
NotesItem file = docInbox.GetFirstItem("$File");
string fileName = ((object[])nItem.Values) [0].ToString();
NotesEmbeddedObject attachfile = (NotesEmbeddedObject)docInbox.GetAttachment(fileName);
if (attachfile != null)
{
attachfile.ExtractFile("C:\\test\\" + fileName);
}
}
但在这里我只得到第一个附件值。 谁能帮我解决这个问题?
【问题讨论】:
-
“版主标志”用于行政支持,而不是对紧急问题的回答。
标签: c# lotus-notes