本文整理汇总了C#中Attachment.get_Fields方法的典型用法代码示例。如果您正苦于以下问题:C# Attachment.get_Fields方法的具体用法?C# Attachment.get_Fields怎么用?C# Attachment.get_Fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment.get_Fields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSignatureRtf
private static bool IsSignatureRtf(Attachment attachment)
{
dynamic field = attachment.get_Fields(PR_ATTACH_METHOD);
if ((field != null) && ((int) field == ATTACH_OLE))
{
try
{
// Only allow file types we DON'T clean to be signatures.
if (FileTypeBridge.GetSupportedFileType(attachment.FileName) == FileType.Unknown)
{
Logger.LogInfo(string.Format("Signature {0} on Rtf formatted message", attachment.FileName));
return true;
}
}
catch (Exception)
{
// When the mail format is rtf you are unable access the filename property of embedded images.
return true;
}
}
return false;
}
示例2: IsSignatureHtml
private static bool IsSignatureHtml(Attachment attachment)
{
dynamic id = attachment.get_Fields(PR_ATTACH_CONTENT_ID);
dynamic idw = attachment.get_Fields(PR_ATTACH_CONTENT_ID_W);
string contentId = string.Empty;
if (id != null)
{
contentId = id.ToString();
}
string contentIdw = string.Empty;
if (idw != null)
{
contentIdw = idw.ToString();
}
if (!string.IsNullOrEmpty(contentId) || !string.IsNullOrEmpty(contentIdw))
{
// Only allow file types we DON'T clean to be signatures.
if (FileTypeBridge.GetSupportedFileType(attachment.FileName) == FileType.Unknown)
{
Logger.LogInfo(string.Format("Signature {0} on Html formatted message", attachment.FileName));
return true;
}
}
return false;
}