Inet Control alternative in vb.net?

R

Rick

Hi,

I haven't been able to find a solution anywhere yet. I have a Vb6
application that has to be rewritten as a vb.net app and
in the old application the inet control was set as:

inet.Protocol = icHTTP
inet.OpenUrl(http://user:[email protected]/Login) format was
used.

I have to take this exact same concept and accomplish it in vb.net.
Has anyone been able to do this?

I've tried doing it through a WebRequest like below:

Dim objRequest as WebRequest =
objRequest.Create(www.somesite.com/Login)
objRequest.Credentials = New NetworkCredential("user", "password")

Dim objResponse as WebResponse = objResponse.GetResponse

I get an error when I get to the GetResponse Line and I was wondering
if anyone ran into the same issues
or knows of a way around this. I would appreciate any help I could
get.

Thanks,
Rick
 
H

Herfried K. Wagner [MVP]

* (e-mail address removed) (Rick) scripsit:
I have to take this exact same concept and accomplish it in vb.net.
Has anyone been able to do this?

I've tried doing it through a WebRequest like below:

Dim objRequest as WebRequest =
objRequest.Create(www.somesite.com/Login)
objRequest.Credentials = New NetworkCredential("user", "password")

Dim objResponse as WebResponse = objResponse.GetResponse

I get an error when I get to the GetResponse Line and I was wondering
if anyone ran into the same issues

Error message?
 
R

Rick Cameron

Before I added the objRequest.Credentials = New
NetworkCredential("user", "password") line, I was getting an
unauthorized user (401).

Now that I added that line I get a request timed out. I don't know if I
have this web request set up the right way.

I can copy and paste the http://user:[email protected]/Login
into a web browser and I see the results I need, but when I try to make
these requests is when I'm running into an issue.

Any ideas?
 
F

Fergus Cooney

Hi Rick,

This isn't my area so I'm just throwing ideas out...

Do you get a timeout if you do the cut&paste to web-browser but with an
incorrect password?

Have you tried setting the domain of the NetworkCredential as well?

I presume you've tried the full
"http://user:[email protected]/Login" in the WebRequest, but as you
haven't mentioned it, I'll point it out just in case.

Good luck.

Regards,
Fergus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top