kpmsiva
August 27th, 2009, 03:56 AM
Hi!
Guys i need to verify the login details of the following website:
In my application i have two fields txtusername, txtpassword, when the user
hit submit button, i have to check the login details true or not.
I tried with webbrowser control. But i need it wil done by background.
My Code:
Public Class Form1
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
WebBrowser1.Document.All("vb_login_username").SetAttribute("value", txtusername.Text)
WebBrowser1.Document.All("vb_login_password").SetAttribute("value", txtpass.Text)
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If WebBrowser1.Document.Body.InnerText.Contains("Forgotten your password?") Then
MsgBox("Incorrect password try again")
End If
End Sub
End Class
How to invoke a button click of login via my program and how to read the response! Please helpme out
Advance thanks
Guys i need to verify the login details of the following website:
In my application i have two fields txtusername, txtpassword, when the user
hit submit button, i have to check the login details true or not.
I tried with webbrowser control. But i need it wil done by background.
My Code:
Public Class Form1
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
WebBrowser1.Document.All("vb_login_username").SetAttribute("value", txtusername.Text)
WebBrowser1.Document.All("vb_login_password").SetAttribute("value", txtpass.Text)
End Sub
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If WebBrowser1.Document.Body.InnerText.Contains("Forgotten your password?") Then
MsgBox("Incorrect password try again")
End If
End Sub
End Class
How to invoke a button click of login via my program and how to read the response! Please helpme out
Advance thanks