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

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

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // The path to the File directory.
            // ExStart:MergeMultiplePST
            string dataDir = RunExamples.GetDataDir_Outlook();
            try
            {
                using (PersonalStorage pst = PersonalStorage.FromFile(dataDir + "PersonalStorage.pst"))
                {
                    // The events subscription is an optional step for the tracking process only.
                    pst.StorageProcessed += PstMerge_OnStorageProcessed;
                    pst.ItemMoved += PstMerge_OnItemMoved;

                    // Merges with the pst files that are located in separate folder.
                    pst.MergeWith(Directory.GetFiles(dataDir + @"\Sources\"));
                    Console.WriteLine("Total messages added: {0}", totalAdded);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose Email License. You can purchase full license or get 30 day temporary license from http:// Www.aspose.com/purchase/default.aspx.");
            }
            // ExEnd:MergeMultiplePST
        }