Access to internet with VB Express Edition

  • Thread starter Thread starter Tosco
  • Start date Start date
doh,

This is not a personal attack to you, it can be read that way I see know, of
course I agree with your message completely.

Cor
 
vb.net is NOT the language of the future.

Learn C# or C++ or Java or PHP.

VB is for lepers and retards; MS killed the language a LONG time ago

-Aaron
 
Tom,

Are you writting this as reply to me. Tom it seems that I write not enough
in these newsgroups.

Otherwise you would see me smile if I see this kind of childness which we
have seldom in the dotNet newsgroups.

Cor

Cor - while in response to your post, it is in no means aimed at you
personally. It is simply venting. I apologize if it came across as an attack
on you.
 
Tom, I don't have any prbolem downloading text or files with the
WebClient when no authentication is required, but when a page requires
authentication it doesn't work.

The old application was just navigating to the URL
"http://www.xyz.com/login.jsp?LoginUsername=name&LoginPassword=pwd"
once, and the session remained alive.

But if I do
WebClient.DownloadString("http://www.xyz.com/login.jsp?LoginUsername=name&LoginPassword=pwd")
I get the page asking me if I forgot the password.

I tried to play with the WebClient.Credentials, but I failed.

Do you understand why?

Thanks,
Stefano
 
Tom, I don't have any prbolem downloading text or files with the
WebClient when no authentication is required, but when a page requires
authentication it doesn't work.

The old application was just navigating to the URL
"http://www.xyz.com/login.jsp?LoginUsername=name&LoginPassword=pwd"
once, and the session remained alive.

But if I do
WebClient.DownloadString("http://www.xyz.com/login.jsp?LoginUsername=name&LoginPassword=pwd")
I get the page asking me if I forgot the password.

I tried to play with the WebClient.Credentials, but I failed.

Do you understand why?

Thanks,
Stefano

Can you show your code using the credentials property? I think that should
look something like:

Dim theWebClient As New WebClient
theWebClient.Credentials = New NetworkCredentials (username, password, server)

....

Anyway - post some code, and maybe we can work this out... (obviously, don't
post any sensitive information :)
 
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
 
Mmmh... the navigate line seems to be too long for the post, I'm going
to split it in 5 shorter lines:

WebBrowser1.Navigate("https://signin.ebay.com/ws/
eBayISAPI.dll?MfcISAPICommand=SignInWelcome&
siteid=0&co_partnerId=2&UsingSSL=1&ru=&pp=&
pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid=" &
UserName & "&pass=" & Password)

Thanks,
Stefano
 
Back
Top