Skip to main content

Java - Get first and last name of user



Here is my situation.





I am writing a program that will store a database. Currently, the way of identifying the user is by their computer user name. I am very desperate here, so any ideas will work. I am looking for ANY method (doesn't always need to work) for BOTH OSX and Windows computers that will somehow fetch the user's first and last name.





Thank you all in advance!


Comments

  1. Many times, the computer won't even know the user's real name -- you realize that, right? That said, there's a Java system property "user.name" which will always contain the login name, on any system:

    String username = System.getProperty("user.name");


    That's the only thing you can get with any reliability.

    ... except for prompting the user. Why not just ask them for their name?

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?