【发布时间】:2011-06-24 17:02:23
【问题描述】:
我有一个NSF,其中包含一封带有两个附件的电子邮件。其中一个附件已损坏,如果我尝试保存它,Notes 会显示此消息The attachment may be corrupted. Would you like to continue with the available data?
如果我单击“是”,Notes 会将损坏的附件保存到我指定的目录中。这很好。
我想在 C# 中使用对象模型来做同样的事情。如果我运行NotesEmbeddedObject.ExtractFile(),我会收到此异常消息:Notes error: Encoded Data Checksum Mismatch - Attachment may be corrupted。没有版本的文件写入我指定的目录。
我希望代码将损坏的版本写入目录。我该怎么做?
现有代码:
//BEGIN Extract Attachment
//nItem is a NotesItem
if (nItem.type == IT_TYPE.ATTACHMENT)
{
try
{
string pAttachment = ((object[])nItem.Values)[0].ToString();
NotesDocument NDoc = NotesConnectionDatabase.AllDocuments.GetNthDocument(i);
NotesEmbeddedObject Neo = NDoc.GetAttachment(pAttachment);
NDoc.GetAttachment(pAttachment).ExtractFile(@"D:\projects\xxx\Attach\" + pAttachment);
}
catch (Exception e)
{
string eMessage = e.Message;
Console.WriteLine(eMessage);
}
}
//END Extract Attachment
【问题讨论】:
标签: c# .net lotus-notes lotus lotus-domino