InvalidPasswordException

InvalidPasswordException class

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

public class InvalidPasswordException : TasksException

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