473,394 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

WebBrowser Control - Setting the UserAgent???

I am writing a win form application in C#, I want to be able to retrieve web
pages using different useragent strings and render the results in a web
browser to see how my app responds to different browsers. I can retrieve
the page and render the results fine. The problem I am having is changing
the useragent.

Any examples, links or info on how to do this would be greatly appreciated.
Nov 16 '05 #1
2 11105
Easiest (and best) way to do this is just to install the other browsers and
use them. :)

Browscap.ini also indicates the user agent, but just changing the user agent
won't cause the browser to render the page the same as the real browser
would.

Netscape 7 + (Mozilla 1.0 and greater) and I.E. 6.0 and greater render
things almost identically. In fact, Mozilla implemented a detection routine
that puts it in "IE" compatible browser mode so that pages that are created
for IE specifically will render the same as they do in IE.

Robert

"Tyrone Bloombaumbergenthal" <Ty***********************@welfare.com> wrote
in message news:Oh**************@TK2MSFTNGP12.phx.gbl...
I am writing a win form application in C#, I want to be able to retrieve web pages using different useragent strings and render the results in a web
browser to see how my app responds to different browsers. I can retrieve
the page and render the results fine. The problem I am having is changing
the useragent.

Any examples, links or info on how to do this would be greatly appreciated.

Nov 16 '05 #2
that's nice but in theory it doesn't work quite so well. search the
framwork.aspnet newsgroup for <browsercaps> section written by teemu kieski.
this allows asp.net to render the correct version of html for the target
browser - this is the real issue.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Robert May" <ra****************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Easiest (and best) way to do this is just to install the other browsers
and
use them. :)

Browscap.ini also indicates the user agent, but just changing the user
agent
won't cause the browser to render the page the same as the real browser
would.

Netscape 7 + (Mozilla 1.0 and greater) and I.E. 6.0 and greater render
things almost identically. In fact, Mozilla implemented a detection
routine
that puts it in "IE" compatible browser mode so that pages that are
created
for IE specifically will render the same as they do in IE.

Robert

"Tyrone Bloombaumbergenthal" <Ty***********************@welfare.com> wrote
in message news:Oh**************@TK2MSFTNGP12.phx.gbl...
I am writing a win form application in C#, I want to be able to retrieve

web
pages using different useragent strings and render the results in a web
browser to see how my app responds to different browsers. I can retrieve
the page and render the results fine. The problem I am having is
changing
the useragent.

Any examples, links or info on how to do this would be greatly

appreciated.


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wesley | last post by:
Hello, My application is hosting three WebBrowser control. What I am trying to do is when the mouse move over one of the WebBrowser controls I want to set the focus on that control so the mouse...
5
by: Ian Stiles | last post by:
I have tried everything under the sun to get rid of horrible flashing and flickering that occurs on a CSharp form when the form hosts a TreeView or WebBrowser control and then you resize the form....
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
2
by: spamlaanbroek | last post by:
The .NET WebBrowser control in the Compact Framework 2.0 is a major headache. Once it takes the focus (e.g. by the user tapping on it) it keeps it and keyboard events are not passed to the form...
1
by: Heidi V.Hundåla | last post by:
I have a WebBrowser-control on my win app and I want to set the size on the images which are displayed through an url like http://blabla.com/img.jpg, but somehow the setting of my WebBrowser...
1
by: JM | last post by:
I am using the WebBrowser control in .NET 2.0 Windows based application. I want to use the default IE security settings, privacy settings etc. Is there a way by which I can achieve this ? ...
1
by: JP2006 | last post by:
Getting a an error with my DLL stating that my control 'cannot be instantiated because the current thread is not in a single-threaded apartment.' The code is: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
1
by: Narasimham | last post by:
Hi, I am trying to use the webbrowser control in the compact framework. I am setting a URL to the webbrowser control and am able to see the page in my handheld device. I have two issues 1. I...
2
by: Scott Gravenhorst | last post by:
I recently (within 30 days) downloaded and installed VB 2005 Express. I like it a whole lot... but: I have been trying to work with the WebBrowser control to display a small amount of help text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.