Thursday, January 28, 2010

Twitter status update from C# application

Download Twitterizer Framework from :


http://twitterizer.googlecode.com/files/Twitterizer.Framework-1.0.1.146.zip

The zip file contains 'Twitterizer.Framework.dll'.  Extract it to a folder.


Design your application interface with the text boxes for Twitter user id and password and the status text.





Project -> Add Reference -> Browse -> Select Twitterizer.Framework.dll

Import the Framework with using keyword and write in Button click event.


Complete Code
 
using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Twitterizer.Framework;



namespace TwStUpdate

{

public partial class Form1 : Form

{

public Form1()

{

          InitializeComponent();

}



private void btnUpdate_Click(object sender, EventArgs e)

{

          Twitter tw = new Twitter(txtUserId.Text, txtPassword.Text);

          tw.Status.Update(txtStatus.Text);

}

}

}