Re: How To retrieve the full user name, in Vista??



apm35@xxxxxxxxxxxxxxxxxx schrieb:
What the OP is asking for is inherently non-portable so no solution is
going to be completely clean. The way I would do it is write a little
C program that returns the username, then invoke it from script that
runs the java program. The script can pass this value as a java
property which is picked up via System.getProperty. I did something
similar for a program I have that needs to know the UNIX pid, which
also cannot be obtained in a portable way.

Regards,

Andrew Marlow


I think it should be arround, from what I saw in J2EE,
but I cannot figure out where it is:

http://java.sun.com/javaee/5/docs/api/javax/xml/registry/infomodel/package-tree.html

There is an interface PersonName. Which has methods
getFullName() and setFullName().

But I don't see what would help me to populate it
from the underlying operating system. Windows and Unix
do have stored user full names.

Probably expensive tool suites like Sun Java System
Identity Manager 5.0 should also be able to access OS
full names I assume.

But I am looking for a simple portable solution.

Bye
.