Find out OS/Browser/....

  • Thread starter Thread starter Mufasa
  • Start date Start date
M

Mufasa

We want to keep track of what OS/Browser people are using for our website.
How can I find that out so that I can write it to a DB ? I know how to get
it into the DB; I just need to know how to get that stuff in .Net.

Thanks.

J.
 
We want to keep track of what OS/Browser people are using for our website.
How can I find that out so that I can write it to a DB ? I know how to get
it into the DB; I just need to know how to get that stuff in .Net.

Thanks.

J.

Hi,
try the Request.Browser object....

a bit of google goes a long way...

O
 
Hello Mufasa,

See HttpRequest.Browser and HttpRequest.UserAgent;

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

M> We want to keep track of what OS/Browser people are using for our
M> website. How can I find that out so that I can write it to a DB ? I
M> know how to get it into the DB; I just need to know how to get that
M> stuff in .Net.
M>
M> Thanks.
M>
M> J.
M>
 
Browser you can find you by reading User_Agent from ServerVaraibles.

Usually staff like that is done with Javascript using Navigator object.
first page that outputted to browser has a JavaScript code that collects all
that info and request a transparent pixel passing all that info as a
parameter.

<script>
....get all info into sVar.....
document.write("<img src=collectdata.aspx?par=" + sVar + " border=0>");
</script>

Good luck. You can look at pretty much any statistical/free counter there
available. They almost all have code to collect visitors data.
GoogleAnalytic for example.

George.
 
Thanks for the info. Problem with google - if you don't know what your
looking for, it can take forever to find anything.

Frequently I've had it where I post a message here and then start googling.
And by the time I find something even close to appropriate, somebody has
already posted here.

But thanks again for the info.

J.
 
Save the following code as "detectBrowser.aspx" and run it :

detectBrowser.aspx:
------------------------------
<%@ Page Language="VB" Trace = "false" EnableViewState= "false" EnableSessionState = "false" Debug =
"false" %>

<script language="VB" runat="server">

Sub Page_Load(sender as Object, e as EventArgs)
BrowserName.Text = Request.Browser.Type & ", " & Request.Browser.Platform

BrowserData.Text = "Type = " & Request.Browser.Type & "<br>"
BrowserData.Text &= "Name = " & Request.Browser.Browser & "<br>"
BrowserData.Text &= "Version = " & Request.Browser.Version & "<br>"
BrowserData.Text &= "Major Version = " & Request.Browser.MajorVersion & "<br>"
BrowserData.Text &= "Minor Version = " & Request.Browser.MinorVersion & "<br>"
BrowserData.Text &= "Platform = " & Request.Browser.Platform & "<br>"
BrowserData.Text &= "Is Beta = " & Request.Browser.Beta & "<br>"
BrowserData.Text &= "Is Crawler = " & Request.Browser.Crawler & "<br>"
BrowserData.Text &= "Is AOL = " & Request.Browser.AOL & "<br>"
BrowserData.Text &= "Is Win16 = " & Request.Browser.Win16 & "<br>"
BrowserData.Text &= "Is Win32 = " & Request.Browser.Win32 & "<br>"
BrowserData.Text &= "Supports Frames = " & Request.Browser.Frames & "<br>"
BrowserData.Text &= "Supports Tables = " & Request.Browser.Tables & "<br>"
BrowserData.Text &= "Supports Cookies = " & Request.Browser.Cookies & "<br>"
BrowserData.Text &= "Supports VB Script = " & Request.Browser.VBScript & "<br>"
BrowserData.Text &= "Supports JavaScript = " & Request.Browser.JavaScript & "<br>"
BrowserData.Text &= "Supports EcmaScript version " & Request.Browser.EcmaScriptVersion.ToString() &
"<br>"
BrowserData.Text &= "Supports Java Applets = " & Request.Browser.JavaApplets & "<br>"
BrowserData.Text &= "CDF = " & Request.Browser.CDF & "<br>"
BrowserData.Text &= "MSDomVersion = " & Request.Browser.MSDomVersion.ToString() & "<br>"
BrowserData.Text &= "SupportsCss = " & Request.Browser.SupportsCss.ToString() & "<br>"
BrowserData.Text &= "W3CDomVersion = " & Request.Browser.W3CDomVersion.ToString() & "<br>"
BrowserData.Text &= "Http_User_Agent = " & Request.ServerVariables("http_user_agent") & "<br>"
End Sub
</script>

<html>
<body>

Your browser is: <asp:literal id="BrowserName" runat="server" />
<p>
<b><u>Here is part of what was detected about your browser's capabilities:</u></b><br />
<asp:literal runat="server" id="BrowserData" />

</body>
</html>

-------------------

HTH...




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top