Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created January 14, 2020 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/d652819a3b5d0ce362d5393abc591e24 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/d652819a3b5d0ce362d5393abc591e24 to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-.NET
public override void Load(System.IO.Stream input)
{
try
{
// check security and load document
SetAccessGranted(true);
}
catch (SomeSecurityException)
{
SetAccessGranted(false);
// Password, provided with LoadOptions
if (string.IsNullOrEmpty(Password))
throw new Exceptions.PasswordRequiredException();
else
throw new Exceptions.IncorrectPasswordException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment