示例#1
0
 private static AuthInfo GetAuthorization(string clientId, string clientSecret)
 {
     try
     {
         return(AppHarborClient.AskForAuthorization(clientId, clientSecret, TimeSpan.FromMinutes(1)));
     }
     catch (AuthenticationException)
     {
         Console.WriteLine("Failed to get authorization");
         Environment.Exit(-1);
         throw;
     }
     catch (TimeoutException)
     {
         Console.WriteLine("Timeout, you have to be faster than that");
         Environment.Exit(-1);
         throw;
     }
 }