I'm making an application that contains a WebBrowser
element and I would like to have the application show the useragent for that user's default browser.
I know how to get both the default browser via Registry keys and how to get the user agent for a browser but cannot figure out how to combine the two. Is this possible?
What I would do (of course, this is a bit of an overkill here) is to include a web server and request an URL from this web server, thus getting the user agent.
I.e. roughly this would include:
WebBrowser
control call a local URL of the webserver (e.g. http://127.0.0.1:48384/test)I've successfully used the web server inside my applications several times. One example would by my HTML edit control over at the Code Project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With