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 :)
Can you send the error you are getting? This can help in figuring out what the problem actually is.
Also, do not the following comment on the Yedda Dev Blog. It seems Twitter changed something on their servers which causes some issue with .NET. The comment specifies a line of code that if used in your app before calling Twitter can fix the problem.
Thank You Eran. The problem was i didn't that that small... itttyyy bittyy line of code placed before i connected. :) Thank you :)
Other people asked questions on similar topics, check out the answers they received:
Other people asked questions on various topics, and are still waiting for answer. Would be great if you can take a sec and answer them