[VB.NET] Twitter Login Form
It is hard figuring out how to make a login app for a
website when there is no “ID” attribute on the HTML code. Unlike facebook,
which has an “ID” it is easy because it tells you right of the bat. Twitter on
the other hand has no ID attribute for the username password or submit button.
So I made this tut on how to login to twitter using TAGNAME instead.
Let’s start of by making a new project. Since this is
just an example we will name it “TwitterLoginEX”. Once your new project is
loaded go to the toolbox and add the following:
2 textboxes
1 button
1 webbrowser
Rename textbox 1 to “USERBOX” and textbox 2 to “PASSBOX”
so it will be easier to remember which is which.
Now double click on the form to enter the form load event and put this code:
WebBrowser1.Navigate("https://mobile.twitter.com/session/new")
WebBrowser1.ScriptErrorsSuppressed = True
Now double click button 1 and enter this:
Dim elements As HtmlElementCollection
= WebBrowser1.Document.GetElementsByTagName("input")
elements(1).SetAttribute("value",
USERBOX.Text)
elements(2).SetAttribute("value", PASSBOX.Text)
elements(3).InvokeMember("Click")
THAT’S IT, YOU JUST MADE A LOGIN TO TWITTER!
1 comments:
thanks this help me much
Replyif you can help me
how can i authorize twitter app by vb.net?
thanks again
Post a Comment
Note: Only a member of this blog may post a comment.