Ejemplo n.º 1
0
 private void TryLogin(TwitterNet twitter)
 {
     try
     {
         // Schedule the update function in the UI thread.
         LayoutRoot.Dispatcher.BeginInvoke(
             System.Windows.Threading.DispatcherPriority.Normal,
             new PostLoginDelegate(UpdatePostLoginInterface), twitter.Login());
     }
     catch (WebException ex)
     {
         logger.Error("There was a problem logging in Twitter.");
         MessageBox.Show("There was a problem logging in to Twitter. " + ex.Message);
     }
     catch (RateLimitException ex)
     {
         logger.Error("There was a rate limit exception.");
         MessageBox.Show(ex.Message);
     }
     catch (ProxyAuthenticationRequiredException ex)
     {
         logger.Error("Incorrect proxy configuration.");
         MessageBox.Show("Proxy server is configured incorrectly.  Please correct the settings on the Options menu.");
     }
 }
Ejemplo n.º 2
0
        public void Init()
        {
            username = "******";
            password = TwitterNet.ToSecureString("WittyTest");
            userId = 14203624; // WittyTest's Twitter id

            TwitterNet twitter = new TwitterNet(username, password);
            testUser = twitter.Login();
        }
Ejemplo n.º 3
0
 public void Login()
 {
     TwitterNet twitter = new TwitterNet(username, password);
     User user = twitter.Login();
     Assert.AreEqual(userId, user.Id);
 }