stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";// Creating an indexIndexindex=newIndex(indexFolder);// Subscribing to the eventindex.Events.PasswordRequired+=(sender,args)=>{if(args.DocumentFullPath.EndsWith("ProtectedDocument.pdf",StringComparison.InvariantCultureIgnoreCase)){args.Password="123456";}};// Indexing documents from the specified folderindex.Add(documentsFolder);