Back to Devexpress

EncryptedFilePasswordRequestEventArgs.Password Property

officefileapi-devexpress-dot-spreadsheet-dot-encryptedfilepasswordrequesteventargs.md

latest3.6 KB
Original Source

EncryptedFilePasswordRequestEventArgs.Password Property

Gets or sets the password used to encrypt the document.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

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

Property Value

TypeDescription
String

A String value that is the encryption password.

|

The following code snippets (auto-collected from DevExpress Examples) contain references 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#L62

csharp
private void SpreadsheetControl1_EncryptedFilePasswordRequest(object sender, EncryptedFilePasswordRequestEventArgs e) {
    if (e.DocumentName == "encrypted_test.xlsx") e.Password = "test";
    if (e.DocumentName == "corrupted.xlsx") e.Password = "000";

spreadsheet-document-api-encryption/CS/EncryptionExample/Program.cs#L73

csharp
Console.WriteLine("Enter password:");
e.Password = Console.ReadLine();
e.Handled = true;

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

vb
Private Sub SpreadsheetControl1_EncryptedFilePasswordRequest(ByVal sender As Object, ByVal e As EncryptedFilePasswordRequestEventArgs)
    If Equals(e.DocumentName, "encrypted_test.xlsx") Then e.Password = "test"
    If Equals(e.DocumentName, "corrupted.xlsx") Then e.Password = "000"

spreadsheet-document-api-encryption/VB/EncryptionExample/Program.vb#L56

vb
Console.WriteLine("Enter password:")
e.Password = Console.ReadLine()
e.Handled = True

See Also

EncryptedFilePasswordRequestEventArgs Class

EncryptedFilePasswordRequestEventArgs Members

DevExpress.Spreadsheet Namespace