• Post Reply Bookmark Topic Watch Topic
  • New Topic

To get user and o.s. info!  RSS feed

 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
How can i get user's logged name and o.s. name, like windows or linux...
is it possible?
Wich class can i use for this purpose!?
Thanks buddies!
Sorry about my english..
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ,
Well you can use java.lang.System class and use the method getProperties(String s) where sting s would be
java.version Java Runtime Environment version
java.vendor Java Runtime Environment vendor
java.vendor.url Java vendor URL
java.home Java installation directory
java.vm.specification.version Java Virtual Machine specification version
java.vm.specification.vendor Java Virtual Machine specification vendor
java.vm.specification.name Java Virtual Machine specification name
java.vm.version Java Virtual Machine implementation version
java.vm.vendor Java Virtual Machine implementation vendor
java.vm.name Java Virtual Machine implementation name
java.specification.version Java Runtime Environment specification version
java.specification.vendor Java Runtime Environment specification vendor
java.specification.name Java Runtime Environment specification name
java.class.version Java class format version number
java.class.path Java class path
os.name Operating system name
os.arch Operating system architecture
os.version Operating system version
file.separator File separator ("/" on UNIX)
path.separator Path separator (":" on UNIX)
line.separator Line separator ("\n" on UNIX)
user.name User's account name
user.home User's home directory
user.dir User's current working directory

Note that even if the security manager does not permit the getProperties operation, it may choose to permit the getProperty(String) operation.
Throws:
SecurityException - if a security manager exists and its checkPropertiesAccess
and please read documentation also.
thanks
jasmine
 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!