Created
November 7, 2014 19:02
-
-
Save andreluizf/c5d28c04ab2b04ce6316 to your computer and use it in GitHub Desktop.
pegar usuario logado no windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args){ | |
System.out.println(System.getProperty("user.name")); | |
//nome da maquina | |
InetAddress addr; | |
try{ | |
addr = InetAddress.getLocalHost(); | |
System.out.println(addr.getHostName()); | |
}catch(UnknownHostException e){ | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment