Aspose.Email.Examples.CSharp.Email.Outlook.ExtractMessagesFromPSTFile.Run C# (CSharp) Метод

Run() публичный статический Метод

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // ExStart:ExtractMessagesFromPSTFile
            // The path to the file directory.
            string dataDir = RunExamples.GetDataDir_Outlook();

            // Load the Outlook file
            string path = dataDir + "PersonalStorage.pst";

            try
            {
                // load the Outlook PST file
                PersonalStorage pst = PersonalStorage.FromFile(path);

                // get the Display Format of the PST file
                Console.WriteLine("Display Format: " + pst.Format);

                // get the folders and messages information
                FolderInfo folderInfo = pst.RootFolder;

                // Call the recursive method to extract msg files from each folder
                ExtractMsgFiles(folderInfo, pst);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            // ExEnd:ExtractMessagesFromPSTFile
        }
ExtractMessagesFromPSTFile