applet getting client computer OS information

Discussion in 'Java' started by jaqu@NOSPAM.ORG, Jan 9, 2005.

  1. Guest

    Hello,

    I am new with sun java (prev used msvj++)

    how can I get client OS information (mostely Windows) like OS ver., SP
    installed, memory installed, etc. in applet ?

    any clues?

    regards,
    jaqu
    , Jan 9, 2005
    #1
    1. Advertising

  2. wrote:


    > how can I get client OS information (mostely Windows) like OS ver., SP
    > installed, memory installed, etc. in applet ?


    In Java you can read out properties, some properties are listed here:
    <http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties()>
    so the OS version should be accessible with
    java.lang.System.getProperty("os.name") + " " +
    java.lang.System.getProperty("os.version")
    but as you are asking for applets be aware that an applet often is not
    allowed to access all existing properties. I have not tried those two
    properties used above in an applet so check yourself.


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 9, 2005
    #2
    1. Advertising

  3. On Sun, 09 Jan 2005 15:05:36 +0100, Martin Honnen wrote:

    > wrote:
    >
    >
    >> how can I get client OS information (mostely Windows) like OS ver., SP


    (shrugs vaguely) What is 'SP' exactly? Service Pack?

    >> installed, memory installed,


    AFAIR, there is no access to tose numbers from S.gP, or
    that I can otherwise locate.

    >>.. etc. in applet ?

    >
    > In Java you can read out properties, some properties are listed here:
    > <http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties()>


    [1]

    > so the OS version should be accessible with
    > java.lang.System.getProperty("os.name") + " " +
    > java.lang.System.getProperty("os.version")
    > but as you are asking for applets be aware that an applet often is not
    > allowed to access all existing properties.


    You can check here. This applet accesses system properties
    and is unsigned.
    <http://www.physci.org/pc/property.jsp>

    >..I have not tried those two properties used above in an applet


    Those work without problem, it is more the 'user' settings and
    a lot of the Java specific properties that are restricted,

    >..so check yourself.


    Well (shrugs) since the information was so close.

    [1] As an aside, System.getProperties() will not work unless
    the applet is signed. Roedy Green's properties applet (linked
    from mine) *is* signed, so his calls System.getProperties and
    simply enumerates the entire set. My version keeps a list of
    common properties and requests each specifically.

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
    Andrew Thompson, Jan 9, 2005
    #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. Mike Grahn

    Getting CLient Information

    Mike Grahn, Jun 12, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    Mike Grahn
    Jun 12, 2004
  2. z. f.
    Replies:
    0
    Views:
    670
    z. f.
    Feb 3, 2005
  3. Jimmy Halim
    Replies:
    0
    Views:
    354
    Jimmy Halim
    Apr 4, 2005
  4. Replies:
    1
    Views:
    261
    Roedy Green
    Sep 13, 2007
  5. Gert Jan
    Replies:
    1
    Views:
    122
    Keith
    Feb 1, 2004
Loading...

Share This Page