Re: How To retrieve the full user name, in Vista??
- From: apm35@xxxxxxxxxxxxxxxxxx
- Date: Fri, 28 Dec 2007 05:27:08 -0800 (PST)
On 27 Dec, 23:33, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
On Fri, 28 Dec 2007 00:15:55 +0100, Jan Burse <janbu...@xxxxxxxxxxx>
wrote, quoted or indirectly quoted someone who said :
Dear All
With the following code:
System.getProperty("user.name");
I can retrieven the user name. But this is
not the full name that is for example displayed
in the login screen and in the start menu by
Windows Vista.
Is there some library call to retrieve
the full name in JDK 1.6+?
Best Regards
if you don't get a better answer, find out how to do it is C++ and
write some JNI. I had to do this to get the Windows-specific VolSer.
Seehttp://mindprod.com/products1.html#VOLSER
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
.
- Follow-Ups:
- Re: How To retrieve the full user name, in Vista??
- From: Jan Burse
- Re: How To retrieve the full user name, in Vista??
- References:
- How To retrieve the full user name, in Vista??
- From: Jan Burse
- Re: How To retrieve the full user name, in Vista??
- From: Roedy Green
- How To retrieve the full user name, in Vista??
- Prev by Date: when will Tuple be std?
- Next by Date: Help with packages getting started
- Previous by thread: Re: How To retrieve the full user name, in Vista??
- Next by thread: Re: How To retrieve the full user name, in Vista??
- Index(es):
Relevant Pages
|