Most modern routers allow you to backup the configuration of the router into a file, and then restore the configuration from the file when it's needed.
The backup file of the router usually contains important data like your ISP user name/password, the login password of the router, and wireless network keys.
If you lost one of these password/keys, but you still have a backup file of your router configuration, RouterPassView might help you to recover your lost password from your router file.
Tools and Utilities
Product page: here