Aspose.Slides.Examples.CSharp.Presentations.Saving.SaveWithPassword.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_PresentationSaving();

            // Create directory if it is not already present.
            bool IsExists = System.IO.Directory.Exists(dataDir);
            if (!IsExists)
                System.IO.Directory.CreateDirectory(dataDir);

            // Instantiate a Presentation object that represents a PPT file
            Presentation pres = new Presentation();

            //....do some work here.....

            // Setting Password
            pres.ProtectionManager.Encrypt("pass");

            // Save your presentation to a file
            pres.Save(dataDir + "SaveWithPassword_out.pptx", Aspose.Slides.Export.SaveFormat.Pptx);
        }
    }
SaveWithPassword