Hosting webbrowser control in Form and specifying Browser type

G

George

My Windows.Form application hosts the WebBrowser control which
interacts with an ASP page that I wrote. How can i detect (on server
side) whether the request is coming in from my WIndows.Form application
or from an instance of IE? Can i set some property on WebBrowser
control?
 
R

Robert May

To detect what browser is hitting the server, you have to look at the
User-Agent header.

Because the WebBrowser control really just encapsulates an instance of
whatever IE browser is on the machine, the User-Agent is set to whatever
IE's user agent is set to.

I couldn't find anything about how to set the User-Agent using the
WebBrowser control, but you can do this by wrapping the AxBrowser control.

Good luck.

Robert
 

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