Aspose.Email.Examples.CSharp.Email.Outlook.ReadingNamedMAPIPropertyFromAttachment.GetNamedPropertyByAspose C# (CSharp) 메소드

GetNamedPropertyByAspose() 개인적인 정적인 메소드

private static GetNamedPropertyByAspose ( ) : string
리턴 string
        private static string GetNamedPropertyByAspose()
        {
            //ExStart:ReadingNamedMAPIPropertyFromAttachment
            // The path to the File directory.
            string dataDir = RunExamples.GetDataDir_Outlook();

            // Load from file
            MailMessage mail = MailMessage.Load(dataDir + "outputAttachments.msg");

            var mapi = MapiMessage.FromMailMessage(mail);

            foreach (MapiNamedProperty namedProperty in mapi.Attachments[0].NamedProperties.Values)
            {
                if (string.Compare(namedProperty.NameId, "CustomAttGuid", StringComparison.OrdinalIgnoreCase) == 0)
                {

                    return namedProperty.GetString();
                }
            }
            return string.Empty;
            //ExEnd:ReadingNamedMAPIPropertyFromAttachment
        }
    }
ReadingNamedMAPIPropertyFromAttachment