title: Verify Twitter User and Post tweet on his on account C#
body: <p>I have single asp.net c# page with three text boxes and a button to post the tweet.</p>
  
  <p>1)  Input user name</p>
  
  <p>2)  Input password</p>
  
  <p>3)  Tweet text</p>
  
  <p>4)  Post tweet button</p>
  
  <p>Problem is that I want to post the tweet on user account. 
  On my webpage first user will enter his user name and password. I will verify the user information from twitter and then post the tweet on his own account.</p>
  
  <p>Something like this which we can do in Twitterizer.</p>
  
  <p>Twitter twitter = new Twitter("username", "password", "source"); </p>
  
  <p>twitter.Status.Update("update"); </p>
  
  <p>I know that now we cannot use Twitterizer.</p>
  
  <p>I have used the example mentioned on the following link but it is also not working.</p>
  
  <p><a href="https://stackoverflow.com/questions/1211128/twitter-verifying-username-and-password-in-c-sharp">Twitter: verifying username and password in C#</a></p>
  
  <p>Sample code
  ///////////////////////////////////////////////////////////////////////////////////////////////////</p>
  
  <pre><code>public bool CheckTwitterCredentials(string UserName, string Password)
  {
      // Assume failure
      bool Result = false;
  
      // A try except block to handle any exceptions
      try {
          // Encode the user name with password
          string UserPass = Convert.ToBase64String(
              System.Text.Encoding.UTF8.GetBytes(UserName + ":" + Password));
  
          // Create our HTTP web request object
          HttpWebRequest Request = 
              (HttpWebRequest)WebRequest.Create("http://twitter.com/account/verify_credentials.xml");
  
          // Set up our request flags and submit type
          Request.Method = "GET";
          Request.ContentType = "application/x-www-form-urlencoded";
  
          // Add the authorization header with the encoded user name and password
          Request.Headers.Add("Authorization", "Basic " + UserPass);
  
          // Use an HttpWebResponse object to handle the response from Twitter
          HttpWebResponse WebResponse = (HttpWebResponse)Request.GetResponse();
  
          // Success if we get an OK response
          Result = WebResponse.StatusCode == HttpStatusCode.OK;
      } catch (Exception Ex) {
          System.Diagnostics.Debug.WriteLine("Error: " + Ex.Message);
      }
  
      // Return success/failure
      return Result;
  }
  </code></pre>
  
  <p>///////////////////////////////////////////////////////////////////////////////////////////////</p>
  
  <p>Now twitter has provided some libraries to work with dot net C#.</p>
  
  <p><a href="https://dev.twitter.com/resources/twitter-libraries#dotnet" rel="nofollow noreferrer">https://dev.twitter.com/resources/twitter-libraries#dotnet</a></p>
  
  <p>.NET</p>
  
  <p>•   LINQ2Twitter by @joemayo (examples)</p>
  
  <p>•   Spring.NET Social extension for Twitter by SpringSource — A Spring.NET Social extension with connection support and an API binding for Twitter.</p>
  
  <p>•   TweetSharp by @danielcrenna — A .net library for Twitter API access</p>
  
  <p>•   Tweetinvi maintained by Linvi — a Twitter .Net C# API which has for mission to simplify the development of application for Twitter in C#. The streaming API has been used on research projects and collected around 3.2 million Tweets a day. The Twitter API has been created to be easy to implement new functionality and currently provide access to most of the functionalities. (documentation)</p>
  
  <p>•   Crafted.Twitter by @martbrow — A caching compatible solution - with implementations for both ASP.Net Web Forms and MVC. Making it easy to include Tweets in your website.</p>
  
  <p>I have used the following library TweetinviAPI. Mentioned on following link.</p>
  
  <p><a href="https://github.com/linvi/tweetinvi/wiki/Introduction#hello-world" rel="nofollow noreferrer">https://github.com/linvi/tweetinvi/wiki/Introduction#hello-world</a></p>
  
  <p>// Set up your credentials (<a href="https://apps.twitter.com" rel="nofollow noreferrer">https://apps.twitter.com</a>)</p>
  
  <pre><code>Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
  
  // Publish the Tweet "Hello World" on your Timeline
  Tweet.PublishTweet("Hello World!");
  </code></pre>
  
  <p>But problem is that it is posting on my own created twitter page not on other user twitter page.</p>
  
  <p>What I want is that by using the above updated libraries is there any way that User put his user name and password on my page and some detail of tweet and post a tweet on his own account.</p>
  
  <p>Please advise me is this possible now or not.</p>
  
  <p>Thanks</p>
  
  <p>Syyed</p>