CodeAve.com CodeAve.com - ASP - Server Variables
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Detecting MSN Explorer
MSN users are now given the MSNExplorer as a "default" browser with the software that comes with the service. Much like AOL does in using IE within the confines of AOL shell, MSN has added features around the MSN browser and have made it trackable on IIS servers utilizing the http_user_agent field. Typically, an http_user_agent value will look something similar to these examples depending on the client OS and browser used
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
Mozilla/4.7 [en] (Win98; I)
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
Mozilla/2.0 (compatible; AOL 3.0; Mac_PowerPC)
Mozilla/4.0 (compatible; MSIE 5.5; AOL 5.0; Windows 98)
the MSN explorer will leave a value like this
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; MSN 6.0) The following example will manipulate the http_user_agent string and display if the browser currently being utilized is MSN Explorer.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com(HTTP User Agent)</title>
<body bgcolor="#FFFFFF">
<%
dim u_agent, g_agent,num_semi,counter
' Get the user agent info from the server
u_agent=request.servervariables("http_user_agent")

' Remove the parenthesis () from the value
u_agent=replace(u_agent,"(",";")
u_agent=replace(u_agent,")",";")

' Remove all 
'u_agent=trim(replace(u_agent," ",""))

g_agent=split(u_agent,";") 
num_semi= ubound(g_agent) %>

<b>http_user_agent:</b> 
<%= request.servervariables("http_user_agent") %>
<br>
<b>agent delimed by semi-colons:</b> 
<%= u_agent %>
<br>
<b>Number of values delimited by the semi-colon:</b> 
<%= num_semi + 1 %>
<br>
<% for counter = 0 to num_semi %>
<%= "<b>agent value #" & counter &":</b> "& g_agent(counter) %><br>
<% next %>
<br><% 
' remove leading and trailing spaces from the last agent value
trim(g_agent(num_semi))

' if the first three characters of the last agent value = MSN
' output that the current browser is the MSN Explorer Browser
if trim(left(g_agent(num_semi),4)) = "MSN" then 
response.write "<b>MSN Explorer is being utilized</b> "
end if %>


</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3