Using ASP to determine the OS

Discussion in 'ASP General' started by Nathan Sokalski, Oct 28, 2003.

  1. 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
    Nathan Sokalski, Oct 28, 2003
    #1
    1. Advertising

  2. Nathan Sokalski

    Ray at Guest

    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

    "Nathan Sokalski" <> wrote in message
    news:...
    > 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
    >
    >
    >
    Ray at, Oct 28, 2003
    #2
    1. Advertising

  3. Nathan Sokalski

    Tom Brown Guest

    "Nathan Sokalski" <> wrote in message
    news:...
    > 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.
    > --




    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)
    Tom Brown, Oct 28, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anita C
    Replies:
    1
    Views:
    2,645
    Hermit Dave
    Dec 23, 2003
  2. =?Utf-8?B?RGV2ZWxvcGVyIGluIENhbGlmb3JuaWE=?=

    How to Determine asp: control ID Name at Runtime in ASP.NET 2.0?

    =?Utf-8?B?RGV2ZWxvcGVyIGluIENhbGlmb3JuaWE=?=, Mar 20, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,007
    Steven Cheng[MSFT]
    Mar 23, 2006
  3. Replies:
    2
    Views:
    1,347
    GaryM
    May 12, 2004
  4. Ben
    Replies:
    5
    Views:
    1,168
    Roedy Green
    Feb 13, 2006
  5. Peña, Botp
    Replies:
    1
    Views:
    221
    Robert Klemme
    Jan 24, 2004
Loading...

Share This Page