getting system account information java?
Is it possible to get the current account information (on computer) things like their usern开发者_开发知识库ame and profile picture using Java? any help would be appreciated
thanks, TC
System account info is available through Java's system properties. For example: System.getProperty("user.name") will return the username of the person who ran the java executable. Similarly, "user.home" will get that user's home directory. There are many properties, if you want the full list, check out System.getProperties().
However, when you say profile picture, it makes me wonder if you're talking about the user account for a web framework. If that's the case, I'm not sure how to help you, since I don't know what web framework you're using (and personally, I wouldn't be much help in any case, I'm not much of a web expert).
See http://download.oracle.com/javase/tutorial/essential/environment/sysprop.html for a a list of system properties available to the JVM on every OS.
You can then access a property using String prop = System.getProperty("user.name")
.
There's no universal access to any profile picture that I know of. There might be OS-specific libraries for that.
精彩评论