I am programming a C# application using yedda for twitter intergration and here is a small look at my code to see if the user's login username and password are correct.
private void btnSave_Click(object sender, EventArgs e)
{
if (txtUserName.Text.Trim() == "")
{
lblSatus.Text = "Please enter Twitter Username";
txtUserName.Focus();
return;
}
if (txtPassword.Text.Trim() == "")
{
lblSatus.Text = "Please enter Twitter Password";
txtPassword.Focus();
return;
}
lblSatus.Text = "";
//Check for Username and Password Validation
Twitter objTwitter = new Twitter();
XmlDocument Updates = default(XmlDocument);
//Try the login
try
{
Updates = objTwitter.GetUserTimelineAsXML(txtUserName.Text.Trim(), txtPassword.Text.Trim(), null, Yedda.Twitter.OutputFormatType.XML);
Properties.Settings.Default.UserName = txtUserName.Text;
Properties.Settings.Default.Password = txtPassword.Text;
}
catch (Exception)
{
MessageBox.Show("Failed to Login to Twitter with the values supplied. Please check your login details.");
txtUserName.Focus();
return;
}
}
I am not sure what is wrong with it. But everytime I hit the save button it always gives me an error, even when the password and username is perfectly correct.... all help is appreciated :)