Aspose.Email.Examples.CSharp.Email.ExtractAttachments.Run C# (CSharp) 메소드

Run() 공개 정적인 메소드

public static Run ( ) : void
리턴 void
        public static void Run()
        {
            // The path to the File directory.
            string dataDir = RunExamples.GetDataDir_Email();

            // Create an instance of MailMessage and load an email file
            MailMessage mailMsg = MailMessage.Load(dataDir + "Test.eml", new EmlLoadOptions());

            foreach (Attachment attachment in mailMsg.Attachments)
            {
                // To display the the attachment file name
                attachment.Save(dataDir + "ExtractAttachments_out." + attachment.Name);
                Console.WriteLine(attachment.Name);
            }           
        }
    }
ExtractAttachments