applet getting client computer OS information

J

jaqu

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
 
M

Martin Honnen

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.
 
A

Andrew Thompson

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

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.
..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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top