我試圖訪問附件名稱形式「$文件」(Lotus Notes)。
NotesView inbox = _serverDatabase.GetView("($Inbox)");
NotesDocument docInbox = inbox.GetFirstDocument();
NotesItem file = docInbox.GetFirstItem("$File");
String fileType = file.type.ToString();
(獲得包含郵件附件的fileType價值 「附件」)
,我沒有得到解決方案中給出:
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);
}
}
但我在這裏只獲得第一個附件值。 任何人都可以幫我解決這個問題嗎?
「管理者標誌」用於管理支持,不是對緊急問題的回答。 – 2009-09-17 15:33:42