InvalidPasswordException Class

Represents the exception type which is thrown when password protected file opening with wrong password.
Inheritance Hierarchy

Namespace:  Aspose.Tasks
Assembly:  Aspose.Tasks (in Aspose.Tasks.dll) Version: 21.10
Syntax
[SerializableAttribute]
public class InvalidPasswordException : TasksException

The InvalidPasswordException type exposes the following members.

Constructors
  NameDescription
Protected methodCode exampleInvalidPasswordException
Initializes a new instance of the InvalidPasswordException class.
Properties
  NameDescription
Public propertyData (Inherited from Exception.)
Public propertyHelpLink (Inherited from Exception.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectData (Inherited from Exception.)
Public methodGetType (Inherited from Exception.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Exception.)
Examples
Shows how to handle <see cref="InvalidPasswordException"/> while reading a password protected project files.
try
{
    var project = new Project(DataDir + "PasswordProtected.mpp");

    // working with project ...
    Console.WriteLine("Project Name: " + project.Get(Prj.Name));
}
catch (TasksReadingException e)
{
    // the message is "The project is password protected. The password is not provided or incorrect."
    Console.WriteLine(e.Message);
}
See Also