all groups > inetserver asp db > october 2003 >
You're in the

inetserver asp db

group:

Using ASP to determine the OS


Using ASP to determine the OS Nathan Sokalski
10/27/2003 7:37:43 PM
inetserver asp db:
I want to determine the operating system using ASP (or VBScript inside of
ASP). I tried to get it using the Request.
ServerVariables(EnvironmentVariable) method. On the web page about ASP in
which I found this method, it gave a list of possible values for the
EnvironmentVariable parameter. One of these, which is the one that I tried
to use, was HTTP_UA_OS. However, this value did not seem to work, and when I
displayed a list of possible values using a For Each loop, it was not in the
list, and none of the other variables looked like they could determine the
OS either. Is this supposed to be an environment variable, and if not, is
there any other way to determine the OS using ASP? Thank You.
--
Nathan Sokalski
njsokalski@hotmail.com

Re: Using ASP to determine the OS Ray at <%=sLocation%
10/27/2003 7:45:31 PM
Make a page like this to see what server variables are available:

For Each au83rfajksk4hrt In Request.ServerVaribles
Response.Write au83rfajksk4hrt & " = " &
Request.ServerVariables(au83rfajksk4hrt) & "<hr>"
Next

Also see here. http://www.aspfaq.com/5004

Ray at home

[quoted text, click to view]

Re: Using ASP to determine the OS Tom Brown
10/28/2003 2:27:54 AM

[quoted text, click to view]



Response.Write Request.ServerVariables("HTTP_USER_AGENT")

This string usually contains some reference to the OS, but it is up to the
browser to determine what it says, and up to you to determine what it means.
Here are some (Win2000) examples:

IE5.5:
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Mozilla:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030728

Opera:
Opera/7.0 (Windows 2000; U) [en]

Netscape4:
Mozilla/4.03 [en] (WinNT; U ;Nav)


AddThis Social Bookmark Button