Aspose.Words.Examples.CSharp.Programming_Documents.Working_With_Document.ProtectDocument.Protect C# (CSharp) Method

Protect() private static method

Shows how to protect document
private static Protect ( string inputFileName ) : void
inputFileName string input file name with complete path.
return void
        private static void Protect(string inputFileName)
        {
            // ExStart:ProtectDocument
            Document doc = new Document(inputFileName);
            doc.Protect(ProtectionType.AllowOnlyFormFields, "password");
            // ExEnd:ProtectDocument
            Console.WriteLine("\nDocument protected successfully.");
          
        }
        /// <summary>