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

Run() 공개 정적인 메소드

public static Run ( ) : void
리턴 void
        public static void Run()
        {
            // The path to the File directory.
            string dataDir = RunExamples.GetDataDir_Outlook();
            string dst = dataDir + "PersonalStorage.pst";

            // Create an instance of MapiMessage from file
            byte[] bytes = File.ReadAllBytes(dataDir + @"message.msg");

            using (MemoryStream stream = new MemoryStream(bytes))
            {
                stream.Seek(0, SeekOrigin.Begin);
                // Create an instance of MapiMessage from file
                MapiMessage msg = MapiMessage.FromStream(stream);

                // Get subject
                Console.WriteLine("Subject:" + msg.Subject);

                // Get from address
                Console.WriteLine("From:" + msg.SenderEmailAddress);

                // Get body
                Console.WriteLine("Body" + msg.Body);

            }
        }
    }
LoadingFromStream