Back to Devexpress

EncryptionOptions.Password Property

officefileapi-devexpress-dot-spreadsheet-dot-encryptionoptions-c83179e2.md

latest3.1 KB
Original Source

EncryptionOptions.Password Property

Gets or sets the password to encrypt the workbook.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
string Password { get; set; }
vb
Property Password As String

Property Value

TypeDescription
String

A String value that is the password for encryption.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Password
DocumentSettings

.Encryption .Password

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Password property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-spreadsheet-load-and-save-a-password-encrypted-files/CS/EncryptionExample/Form1.cs#L51

csharp
workbook.DocumentSettings.Encryption.Type = (EncryptionType)Enum.Parse(typeof(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString());
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString();
spreadsheetControl1.SaveDocumentAs();

winforms-spreadsheet-load-and-save-a-password-encrypted-files/VB/EncryptionExample/Form1.vb#L52

vb
workbook.DocumentSettings.Encryption.Type = CType([Enum].Parse(GetType(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString()), EncryptionType)
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString()
spreadsheetControl1.SaveDocumentAs()

See Also

EncryptionOptions Interface

EncryptionOptions Members

DevExpress.Spreadsheet Namespace