I think you should read a book or two. Answers to your questions are quite evident. If your role is of a .Net developer in company, tell them you are not one. If you are a student, try following:
Put a break point at the following line in your code:
bool Authenticated = false;
Step through and into the code (use F11 to debug and not F10). This should help you understand how this works.
Hope this helps.