Aspose.Words.Examples.CSharp.Programming_Documents.Working_With_Document.ProtectDocument.Protect C# (CSharp) Метод

Protect() приватный статический Метод

Shows how to protect document
private static Protect ( string inputFileName ) : void
inputFileName string input file name with complete path.
Результат 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>