Login Capabilities and App Protection

How to add login capabilities to an ASP.NET Web Pages application, and how to help protect the application from bots.