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

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

public static Run ( ) : void
Результат void
        public static void Run()
        {
            // The path to the File directory.
            // ExStart:SplitSinglePSTInToMultiplePST
            string dataDir = RunExamples.GetDataDir_Outlook();
            try
            {
                String dstSplit = dataDir + Convert.ToString("Chunks\\");

                // Delete the files if already present
                foreach (string file__1 in Directory.GetFiles(dstSplit))
                {
                    File.Delete(file__1);
                }

                using (PersonalStorage personalStorage = PersonalStorage.FromFile(dataDir + "Sub.pst"))
                {
                    // The events subscription is an optional step for the tracking process only.
                    personalStorage.StorageProcessed += PstSplit_OnStorageProcessed;
                    personalStorage.ItemMoved += PstSplit_OnItemMoved;

                    // Splits into pst chunks with the size of 5mb
                    personalStorage.SplitInto(5000000, dataDir + @"\Chunks\");
                }
            }
            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:SplitSinglePSTInToMultiplePST
        }