When I try to get the netscape version for version 7, I get the
HttpBrowserCapa bilities class returning the version as 5 and not 7.
(see code and output below)
CODE
HttpBrowserCapa bilities bc;
string s;
bc = Request.Browser ;
....
s += "Type = " + bc.Type + "<br>" + "\n";
s += "Name = " + bc.Browser + "<br>" + "\n";
s += "Version = " + bc.Version + "<br>" + "\n";
s += "Major Version = " + bc.MajorVersion + "<br>" + "\n";
s += "Minor Version = " + bc.MinorVersion + "<br>" + "\n";
OUTPUT
Type = Netscape5
Name = Netscape
Version = 5.0
Major Version = 5
Minor Version = 0
When I use
s += Request.ServerV ariables["http_user_agen t"];
I get the output
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2)
Gecko/20030208 Netscape/7.02
which does contain the version 7.02 in the string.
Do I need to use the ServerVariables string to get the correct version
number or is there a better way???
Earl 4 2817
Earl,
Let me look into this. At first glance, I'd say that the Regular
Expressions in the browserCaps element in the machine.config file need to
be updated to recognize Netscape 7.
I'll update you as soon as I can.
Jim Cheshire [MSFT]
Developer Support
ASP.NET ja******@online .microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- From: ea******@hotmai l.com (Earl T) Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet Subject: HttpBrowserCapa bilities not returning correct netscape version Date: 14 Oct 2003 14:11:19 -0700 Organization : http://groups.google.com Lines: 40 Message-ID: <ad************ **************@ posting.google. com> NNTP-Posting-Host: 12.45.135.78 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google. com 1066165879 29724 127.0.0.1 (14 Oct 2003
21:11:19 GMT)X-Complaints-To: gr**********@go ogle.com NNTP-Posting-Date: Tue, 14 Oct 2003 21:11:19 +0000 (UTC) Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new s-out.cwix.com!ne wsfeed.cwix.co
m!news.maxwell. syr.edu!postnew s1.google.com!n ot-for-mailXref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1841 39 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
When I try to get the netscape version for version 7, I get the HttpBrowserCap abilities class returning the version as 5 and not 7. (see code and output below)
CODE HttpBrowserCap abilities bc; string s; bc = Request.Browser ; ... s += "Type = " + bc.Type + "<br>" + "\n"; s += "Name = " + bc.Browser + "<br>" + "\n"; s += "Version = " + bc.Version + "<br>" + "\n"; s += "Major Version = " + bc.MajorVersion + "<br>" + "\n"; s += "Minor Version = " + bc.MinorVersion + "<br>" + "\n";
OUTPUT
Type = Netscape5 Name = Netscape Version = 5.0 Major Version = 5 Minor Version = 0
When I use
s += Request.ServerV ariables["http_user_agen t"];
I get the output
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
which does contain the version 7.02 in the string.
Do I need to use the ServerVariables string to get the correct version number or is there a better way???
Earl
Jim,
After looking in the BrowserCaps section, I would say you are probably
correct. There is a regular expression to find netscape v6 but not v7. I
tried to add a case statement for v7 but it did not work (maybe because I no
nothing of how this really works)
I am sure that others must have run up against this and found a
solution???(lik e an updated browsercaps section)
Earl
"Jim Cheshire [MSFT]" <ja******@onlin e.microsoft.com > wrote in message
news:Rp******** ******@cpmsftng xa06.phx.gbl... Earl,
Let me look into this. At first glance, I'd say that the Regular Expressions in the browserCaps element in the machine.config file need to be updated to recognize Netscape 7.
I'll update you as soon as I can.
Jim Cheshire [MSFT] Developer Support ASP.NET ja******@online .microsoft.com
This post is provided as-is with no warranties and confers no rights.
--------------------From: ea******@hotmai l.com (Earl T) Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet Subject: HttpBrowserCapa bilities not returning correct netscape version Date: 14 Oct 2003 14:11:19 -0700 Organization : http://groups.google.com Lines: 40 Message-ID: <ad************ **************@ posting.google. com> NNTP-Posting-Host: 12.45.135.78 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google. com 1066165879 29724 127.0.0.1 (14 Oct 2003 21:11:19 GMT)X-Complaints-To: gr**********@go ogle.com NNTP-Posting-Date: Tue, 14 Oct 2003 21:11:19 +0000 (UTC) Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new s-out.cwix.com!ne wsfeed.cwix.co m!news.maxwell. syr.edu!postnew s1.google.com!n ot-for-mailXref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1841 39X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
When I try to get the netscape version for version 7, I get the HttpBrowserCap abilities class returning the version as 5 and not 7. (see code and output below)
CODE HttpBrowserCap abilities bc; string s; bc = Request.Browser ; ... s += "Type = " + bc.Type + "<br>" + "\n"; s += "Name = " + bc.Browser + "<br>" + "\n"; s += "Version = " + bc.Version + "<br>" + "\n"; s += "Major Version = " + bc.MajorVersion + "<br>" + "\n"; s += "Minor Version = " + bc.MinorVersion + "<br>" + "\n";
OUTPUT
Type = Netscape5 Name = Netscape Version = 5.0 Major Version = 5 Minor Version = 0
When I use
s += Request.ServerV ariables["http_user_agen t"];
I get the output
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
which does contain the version 7.02 in the string.
Do I need to use the ServerVariables string to get the correct version number or is there a better way???
Earl
Jim,
I found this code in another artical on this newsgroup and it now reports
the correct netscape (major) version, which is all I care about. I added it
to my web.config file but suppose I can add it to the machine.config
instead?
Earl
Try this code in your web.config file (place between the <system.web> tags)
<browserCaps>
<case match="Gecko/[-\d]+">
browser=Netscap e
frames=true
tables=true
cookies=true
javascript=true
javaapplets=tru e
ecmascriptversi on=1.5
w3cdomversion=1 .0
css1=true
css2=true
xml=true
tagwriter=Syste m.Web.UI.HtmlTe xtWriter
<case match="rv:1.0[^\.](?'letters'\w*) ">
version=6.0
majorversion=6
minorversion=0
<case match="^b" with="${letters }">
beta=true
</case>
</case>
<case match="rv:1(\.\ d+)(\.\d)?(?'le tters'\w*)">
version=7.0
majorversion=7
minorversion=0
<case match="^b" with="${letters }">
beta=true
</case>
</case>
</case>
</browserCaps>
"Jim Cheshire [MSFT]" <ja******@onlin e.microsoft.com > wrote in message
news:Rp******** ******@cpmsftng xa06.phx.gbl... Earl,
Let me look into this. At first glance, I'd say that the Regular Expressions in the browserCaps element in the machine.config file need to be updated to recognize Netscape 7.
I'll update you as soon as I can.
Jim Cheshire [MSFT] Developer Support ASP.NET ja******@online .microsoft.com
This post is provided as-is with no warranties and confers no rights.
--------------------From: ea******@hotmai l.com (Earl T) Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet Subject: HttpBrowserCapa bilities not returning correct netscape version Date: 14 Oct 2003 14:11:19 -0700 Organization : http://groups.google.com Lines: 40 Message-ID: <ad************ **************@ posting.google. com> NNTP-Posting-Host: 12.45.135.78 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google. com 1066165879 29724 127.0.0.1 (14 Oct 2003 21:11:19 GMT)X-Complaints-To: gr**********@go ogle.com NNTP-Posting-Date: Tue, 14 Oct 2003 21:11:19 +0000 (UTC) Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!new s-out.cwix.com!ne wsfeed.cwix.co m!news.maxwell. syr.edu!postnew s1.google.com!n ot-for-mailXref: cpmsftngxa06.ph x.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1841 39X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
When I try to get the netscape version for version 7, I get the HttpBrowserCap abilities class returning the version as 5 and not 7. (see code and output below)
CODE HttpBrowserCap abilities bc; string s; bc = Request.Browser ; ... s += "Type = " + bc.Type + "<br>" + "\n"; s += "Name = " + bc.Browser + "<br>" + "\n"; s += "Version = " + bc.Version + "<br>" + "\n"; s += "Major Version = " + bc.MajorVersion + "<br>" + "\n"; s += "Minor Version = " + bc.MinorVersion + "<br>" + "\n";
OUTPUT
Type = Netscape5 Name = Netscape Version = 5.0 Major Version = 5 Minor Version = 0
When I use
s += Request.ServerV ariables["http_user_agen t"];
I get the output
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
which does contain the version 7.02 in the string.
Do I need to use the ServerVariables string to get the correct version number or is there a better way???
Earl
Hi Earl,
You can add it to either. However, if you want it available to any Web
application, the machine.config is probably the way to go.
Jim Cheshire [MSFT]
Developer Support
ASP.NET ja******@online .microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- From: "Earl Teigrob" <ea******@hotma il.com> References: <ad************ **************@ posting.google. com>
<Rp************ **@cpmsftngxa06 .phx.gbl>Subject: Re: HttpBrowserCapa bilities not returning correct netscape version Date: Wed, 15 Oct 2003 09:00:26 -0500 Lines: 159 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <Or************ *@tk2msftngp13. phx.gbl> Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet NNTP-Posting-Host: 12.45.135.72 Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1843 09 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
Jim,
I found this code in another artical on this newsgroup and it now reports the correct netscape (major) version, which is all I care about. I added it to my web.config file but suppose I can add it to the machine.config instead?
Earl
Try this code in your web.config file (place between the <system.web> tags)
<browserCaps >
<case match="Gecko/[-\d]+">
browser=Netsca pe
frames=true
tables=true
cookies=true
javascript=tru e
javaapplets=tr ue
ecmascriptvers ion=1.5
w3cdomversion= 1.0
css1=true
css2=true
xml=true
tagwriter=Syst em.Web.UI.HtmlT extWriter
<case match="rv:1.0[^\.](?'letters'\w*) ">
version=6.0
majorversion =6
minorversion =0
<case match="^b" with="${letters }">
beta=true
</case>
</case>
<case match="rv:1(\.\ d+)(\.\d)?(?'le tters'\w*)">
version=7.0
majorversion =7
minorversion =0
<case match="^b" with="${letters }">
beta=true
</case>
</case>
</case>
</browserCaps> "Jim Cheshire [MSFT]" <ja******@onlin e.microsoft.com > wrote in message news:Rp******* *******@cpmsftn gxa06.phx.gbl.. . Earl,
Let me look into this. At first glance, I'd say that the Regular Expressions in the browserCaps element in the machine.config file need to be updated to recognize Netscape 7.
I'll update you as soon as I can.
Jim Cheshire [MSFT] Developer Support ASP.NET ja******@online .microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- >From: ea******@hotmai l.com (Earl T) >Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet >Subject: HttpBrowserCapa bilities not returning correct netscape version >Date: 14 Oct 2003 14:11:19 -0700 >Organization : http://groups.google.com >Lines: 40 >Message-ID: <ad************ **************@ posting.google. com> >NNTP-Posting-Host: 12.45.135.78 >Content-Type: text/plain; charset=ISO-8859-1 >Content-Transfer-Encoding: 8bit >X-Trace: posting.google. com 1066165879 29724 127.0.0.1 (14 Oct 2003 21:11:19 GMT) >X-Complaints-To: gr**********@go ogle.com >NNTP-Posting-Date: Tue, 14 Oct 2003 21:11:19 +0000 (UTC) >Path: cpmsftngxa06.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne ws-out.cwix.com!ne wsfeed.cwix.c
o m!news.maxwell. syr.edu!postnew s1.google.com!n ot-for-mail >Xref: cpmsftngxa06.ph x.gblmicrosoft.publ ic.dotnet.frame work.aspnet:184 139 >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet > >When I try to get the netscape version for version 7, I get the >HttpBrowserCap abilities class returning the version as 5 and not 7. >(see code and output below) > > >CODE >HttpBrowserCap abilities bc; >string s; >bc = Request.Browser ; >... >s += "Type = " + bc.Type + "<br>" + "\n"; >s += "Name = " + bc.Browser + "<br>" + "\n"; >s += "Version = " + bc.Version + "<br>" + "\n"; >s += "Major Version = " + bc.MajorVersion + "<br>" + "\n"; >s += "Minor Version = " + bc.MinorVersion + "<br>" + "\n"; > > >OUTPUT > >Type = Netscape5 >Name = Netscape >Version = 5.0 >Major Version = 5 >Minor Version = 0 > >When I use > >s += Request.ServerV ariables["http_user_agen t"]; > >I get the output > >Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) >Gecko/20030208 Netscape/7.02 > >which does contain the version 7.02 in the string. > >Do I need to use the ServerVariables string to get the correct version >number or is there a better way??? > >Earl > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: j erickson |
last post by:
with the following xsl and xml file, the display of the gif file with
the <image/url> tag works. However, the gif file in the <description>
tag using the name attribute "src" won't make the correct link to the
gif file. why?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
by: Roger Redford |
last post by:
Dear Experts,
I'm attempting to marry a system to an Oracle 817 datbase.
Oracle is my specialty, the back end mainly, so I don't
know much about java or javascript.
The system uses javascript to make ODBC calls to the db.
The particular system I'm working with, will not work
with an Oracle stored procedure I'm told. However, it
|
by: Derrick |
last post by:
Hello all;
Since I do have working code, this is more for my curiosity only.
I'm creating a "Plugin" architecture, following some of the many examples on
the 'net. Basically what I have is this:
- a DLL which contains the interface that every plugin must implement
(IPlugin). This DLL also contains a class with the ability to search for
DLLs in the calling applications working directory that contain classes
implementing IPlugin (I...
|
by: Earl T |
last post by:
When I try to get the netscape version for version 7, I get the
HttpBrowserCapabilities class returning the version as 5 and not 7.
(see code and output below)
CODE
HttpBrowserCapabilities bc;
string s;
bc = Request.Browser;
....
|
by: kevinwjames |
last post by:
I'm writing a C# app which analyzes and reports on IIS web logs. I've
got it producing numbers for hits, visits, ips, etc. but I'm having
trouble parsing the UserAgent string so I can get Browser, OS, and
Version information.
So I saw this great System.Web.HTTPBrowserCapabilities object which
will parse the User Agent string for me and tell me everything I need.
Only problem is there's no easy way to create an instance of this
object...
| |
by: Nathan Sokalski |
last post by:
I was testing out a page of mine that displays the information from
Page.Request.Browser. It works exactly as I expected in Internet Explorer
and Netscape 4.75 (I didn't expect much in Netscape 4.75, but I got some
stuff). However, Netscape 7.1 gave me some strange stuff, including the
following:
1. It gave the Version as 5.0 rather than 7.1, and the Type as Netscape5
2. ASP.NET did not send any CSS other than the constant part that I...
|
by: Robert W. |
last post by:
I just added this line of code to a simple aspx page:
HttpBrowserCapabilities browserCap = new HttpBrowserCapabilities();
Yet when I used QuickWatch in Debug mode to inspect 'browserCap' all the
properties were null. How come?
--
Robert W.
Vancouver, BC
|
by: I.M. !Knuth |
last post by:
Hi. I'm more-or-less a C newbie. I thought I had pointers under control until
I started goofing around with this:
================================================================================
/* A function that returns a pointer-of-arrays to the calling function. */
#include <stdio.h>
int *pfunc(void);
|
by: =?Utf-8?B?Wm9sdA==?= |
last post by:
Hi,
Would someone know where I could get a list of the supported crawlers for
the HttpBrowserCapabilities?
Is there a way to add new ones/modify the list?
I have a web site for which I want to show a different content for search
engine bots. I was planning on relying on HttpBrowserCapabilities.crawler,
but what if the bot signature changes, or there is another one added, ...
Thanks,
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |