|
-
Feb 26th, 2011, 11:06 AM
#1
Thread Starter
New Member
Going to a URL with a VB.NET WebBrowser gives a different result than Firefox?
My problem's simple. I'm attempting to load a login page for a site in a VB.NET WebBrowser control.
When I go to the site in Firefox, I see the site like normal.
When I go to the site with my VB.NET WebBrowser control, I get a 401: Unauthorized error.
What could cause the WebBrowser to load something differently than Firefox? Is there any way around this?
-
Feb 26th, 2011, 11:22 AM
#2
Hyperactive Member
Re: Going to a URL with a VB.NET WebBrowser gives a different result than Firefox?
 Originally Posted by joyner.cn
My problem's simple. I'm attempting to load a login page for a site in a VB.NET WebBrowser control.
When I go to the site in Firefox, I see the site like normal.
When I go to the site with my VB.NET WebBrowser control, I get a 401: Unauthorized error.
What could cause the WebBrowser to load something differently than Firefox? Is there any way around this?
What is the url you are trying to navigate?
-
Feb 26th, 2011, 11:52 AM
#3
Re: Going to a URL with a VB.NET WebBrowser gives a different result than Firefox?
Maybe the website checks the browser type/agent...
To try this, use the Navigate method with extra parameters, for example:
vb.net Code:
WebBrowser1.Navigate("URL", "TargetFrame", null, "User-Agent: CustomUserAgent\r\n")
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Feb 26th, 2011, 01:11 PM
#4
Thread Starter
New Member
Re: Going to a URL with a VB.NET WebBrowser gives a different result than Firefox?
Oh, interesting. That latter solution helped me find the problem, it was just a dumb issue on my part.
Basically, my program checks to see if I'm already logged in by checking to see if my username appears on the homepage. If it doesn't, it logs in; if it does, it goes on to the next page. That 'next page' is where I was getting a 401 error, but the problem was that I wasn't actually logged in -- but on the front page of the site, an article by me was featured, so my username still appeared.
Silly me. Thanks for that tip, that's really useful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|