Introduction

In this tutorial we will learn how to post a Tweet on Twitter.com using ASP.Net and C#. The Twitter website was built to make it easy for developers to access certain functions on the website like posting.

Step 1. Setting up the Form

1. Create a new Web Form named “Default.aspx”.
2. Place a TextBox on the Form called “TextBox1”.
3. Place a Button on the Form named “Button1”.
4. These are the only controls that we need as we will be Hard Coding the Login info in the Code Behind

Step 2. The Tweet Code

1. Open up the Code-Behind for the Form “Default.aspx.cs” by double clicking on the button Control.
2. Copy the code below into your program.
3. Find the Lines that look like this:

and insert your user name and password inside the quotes.

4. Now build then run the program
5. Insert text into the TextBox and click the button, after a few seconds this should post a Tweet onto your account.

It should look like this once you are completed.

Conclusion

In this tutorial we learned how to Post a Tweet on Twitter.com using C# and ASP.NET. This can come in handy for making custom Twitter web pages, or Twitter Applications.