Created
December 21, 2015 15:19
-
-
Save miklund/1afdbab7c1c6cf7f5084 to your computer and use it in GitHub Desktop.
2009-03-02 Where do you want to goto today?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Title: Where do you want to goto today? | |
| # Author: Mikael Lundin | |
| # Link: http://blog.mikaellundin.name/2009/03/02/where-do-you-want-to-goto-today.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void LogIn(ILoginService client, string username, string password) | |
| { | |
| int attempt = 0; | |
| LoginAttempt: | |
| try | |
| { | |
| client.OpenConnection(); | |
| client.Authenticate(username, password); | |
| } | |
| catch (SecurityException) | |
| { | |
| if (attempt++ < 3) | |
| goto LoginAttempt; | |
| throw; | |
| } | |
| finally | |
| { | |
| client.CloseConnection(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment