I was in a similar type of problem before some days, where I wanted to populate data like UserName and Password to any website from my code.
Check my question -
Integrating email clients in one website using C#.Net / ASP.Net[
^].
You can find useful codes for your implementation at
How login to a website[
^] and
Yahoo Login Via System.Net.Sockets Namespace[
^].
If you are using WebBrowser control, then it will be easy for you with these codes.
I have implemented and it is working fine.
I can populate data to any website's textboxes.
The codes just goes through all the controls in the page and finds the textboxes according to some condition.
Let me explain the code -
Dim theElementCollection As HtmlElementCollection
theElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("input")
For Each curElement As HtmlElement In theElementCollection
Dim controlName As String = curElement.GetAttribute("name").ToString
If controlName = "USERNAME" Then
curElement.SetAttribute("Value", "Your username")
ElseIf controlName = "PASSWORD" Then
curElement.SetAttribute("Value", "Your password")
End If
Next
Here it is searching with the "name" attribute of all the "input" elements.
And if the name attribute is "USERNAME", then it fills with the username data you provide and if it is "PASSWORD", then it fills with the password data you provide.
Just try to implement the code present in the links and you will do it for sure.
Thanks,
Tadit