Back to Devexpress

EncryptedFilePasswordCheckFailedEventArgs.Error Property

officefileapi-devexpress-dot-xtrarichedit-dot-encryptedfilepasswordcheckfailedeventargs.md

latest5.2 KB
Original Source

EncryptedFilePasswordCheckFailedEventArgs.Error Property

Obtains the error type caused the event to raise.

Namespace : DevExpress.XtraRichEdit

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public RichEditDecryptionError Error { get; }
vb
Public ReadOnly Property [Error] As RichEditDecryptionError

Property Value

TypeDescription
RichEditDecryptionError

One of the RichEditDecryptionError enumeration values indicating the error type.

|

Available values:

NameDescription
PasswordRequired

Indicates that the file is encrypted and you should set the RichEditDocumentImportOptions.EncryptionPassword or EncryptedFilePasswordRequestedEventArgs.Password property to a password string

| | WrongPassword |

The password specified by the RichEditDocumentImportOptions.EncryptionPassword property is incorrect.

| | EncryptionTypeNotSupported |

Indicates that the encryption type is not supported. For example, this error occurs when you open a DOC file that uses RC4 CryptoAPI encryption with third-party cryptographic service providers.

| | IntegrityCheckFailed |

Indicates that the document did not pass the HMAC verification.

|

Remarks

The Error property returns RichEditDecryptionError.PasswordRequired or RichEditDecryptionError.WrongPassword.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Error 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-richedit-document-encryption/CS/RichEditControl_Encryption/Form1.cs#L49

csharp
//or create an empty file
switch (e.Error)
{

word-document-api-open-and-save-encrypted-files/CS/Program.cs#L71

csharp
{
    switch (e.Error)
    {

wpf-richedit-document-encryption/CS/DXRichEdit_Encryption/MainWindow.xaml.cs#L86

csharp
//Analyze the error led to this event
switch (e.Error)
{

winforms-richedit-document-encryption/VB/RichEditControl_Encryption/Form1.vb#L41

vb
'or create an empty file
Select Case e.Error
    Case RichEditDecryptionError.PasswordRequired

word-document-api-open-and-save-encrypted-files/VB/Program.vb#L54

vb
Private Shared Sub Server_EncryptedFilePasswordCheckFailed(ByVal sender As Object, ByVal e As EncryptedFilePasswordCheckFailedEventArgs)
    Select Case e.Error
        Case RichEditDecryptionError.PasswordRequired

wpf-richedit-document-encryption/VB/DXRichEdit_Encryption/MainWindow.xaml.vb#L81

vb
'Analyze the error led to this event
Select Case e.Error
    Case RichEditDecryptionError.PasswordRequired

See Also

EncryptedFilePasswordCheckFailedEventArgs Class

EncryptedFilePasswordCheckFailedEventArgs Members

DevExpress.XtraRichEdit Namespace