Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mac or pc detection

    hey guys,
    is there an asp script that detects the if PC or MAC?
    i have a flash file that detects the windows system clock but cannot detect the mac clock,

    i just need to put it in an if statemnt eg.

    if computer = mac then
    'Mac
    else
    'PC
    end if

    thanks in advance,

    cheers

    baleric

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    This is a client-side javascript question?

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,625
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Quote Originally Posted by Spudhead View Post
    This is a client-side javascript question?
    No it isn't because Javascript has no access to the hardware to determine what sort of computer it is.

    Javascript is even dependent on the browser identifying the operating system and the browser wont correctly identify operating systems released after it was and may not correctly identify operating systems released before it was. If someone has a Mac that is running Windows XP and IE6 then chances are that the operating system will be reported as Windows 5 and that there will be no indication whatever that it is a Mac rather than a PC.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Ok, let me put it another way: it's not an ASP question, and you're probably going to have more luck resolving the underlying issue by moving this into the client-side javascript forum - where most questions about identifying the client platform occur - than in here where only two of us have replied and we can't even agree on an answer.

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    287
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Coudn't you get your answer from the Request.ServerVariables collection?

    fv

  • #6
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    The server variables give you information about the server (hence the name) not the client.
    OracleGuy

  • #7
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,625
    Thanks
    0
    Thanked 645 Times in 635 Posts
    You can't get information about the client unless the client is configured to tell you. If the client has decent security installed then it wont tell you much. If the person is running Internet Explorer then you know that they are running Windows because that is the only operating system that IE runs on but there is still no way to tell if they are running Windows on a PC or a Mac The only browser where you can be sure they are using a Mac is Safari as that browser only runs on the Mac. All other browsers run on at least PCs and Macs and many of them also run on PDAs, Mobile Phones, and numerous other devices. Apast from the available display window the device that the browser is running on is irrelevant as far as the browser displaying web pages is concerned and the browser only knows as much about the hardware as the operating system tells it anyway (which is almost nothing).
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #8
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The HTTP_USER_AGENT server variable will give you info about the browser and OS.

    Note that those details can be spoofed, so it is not 100% reliable.


    Have a look at this Javascript Browser Sniffer script to see some of the things you can check for in the HTTP_USER_AGENT server variable.
    http://www.mozilla.org/docs/web-deve...wser_type.html

  • #9
    Regular Coder
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    287
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    You can't get information about the client unless the client is configured to tell you. If the client has decent security installed then it wont tell you much. If the person is running Internet Explorer then you know that they are running Windows because that is the only operating system that IE runs on but there is still no way to tell if they are running Windows on a PC or a Mac The only browser where you can be sure they are using a Mac is Safari as that browser only runs on the Mac. All other browsers run on at least PCs and Macs and many of them also run on PDAs, Mobile Phones, and numerous other devices. Apast from the available display window the device that the browser is running on is irrelevant as far as the browser displaying web pages is concerned and the browser only knows as much about the hardware as the operating system tells it anyway (which is almost nothing).
    Actually Macs will run older versions of IE. There is a Mac laptop sitting in my kitchen with IE loaded on it running Mac OS X. For that matter, it could be a Linux machine running the Wine emulator running IE (why bother? ;-)


    fv


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •