Tom, this is an example of code to test the sign in in ebay.com.
Create a form with one WebBrowser and two TextBoxes and paste the code
in the form class. If you have an ebay account you can use your user
name and password to test it.
The function TestWebClient() doesn't work.
The function TestWebBrowser() works, but I would like not to use the
WebBrowser object.
Public Class ebay
Dim UserName As String = "xxx"
Dim Password As String = "yyy"
Dim Server As String = "
http://my.ebay.com"
Dim TestPage As String = "
http://my.ebay.com/ws/eBayISAPI.dll?MyeBay"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.Show()
TestWebClient()
TestWebBrowser()
End Sub
Sub TestWebClient()
Dim Client1 As New Net.WebClient
TextBox1.Text = Client1.DownloadString(TestPage)
Client1.Credentials = New Net.NetworkCredential(UserName, Password,
Server)
TextBox2.Text = Client1.DownloadString(TestPage)
MsgBox(TextBox1.Text.Contains("Sign out") & " - " &
TextBox2.Text.Contains("Sign out"))
End Sub
Sub TestWebBrowser()
Static n As Int16
n = n + 1
Select Case n
Case 1
WebBrowser1.Navigate(TestPage)
Case 2
TextBox1.Text = WebBrowser1.Document.Body.InnerText
WebBrowser1.Navigate("
https://signin.ebay.com/ws/eBayISAP...&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid="
& UserName & "&pass=" & Password)
Case 3
WebBrowser1.Navigate(TestPage)
Case 4
TextBox2.Text = WebBrowser1.Document.Body.InnerText
MsgBox(TextBox1.Text.Contains("Sign out") & " - " &
TextBox2.Text.Contains("Sign out"))
End Select
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object,
ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
Handles WebBrowser1.DocumentCompleted
TestWebBrowser()
End Sub
End Class