Comments

 
User Comments for the tutorial:

Java get windows Username



Total comments: 1      View Tutorial    Discuss: Java get windows Username

Advertisement

Comments

use NTSystem.getName() instead
With Java >= 5.0 on Windows you can also use String userName = new com.sun.security.auth.module.NTSystem().getName(); System.getProperty("user.name") is much less secure because a user cat set the USERNAME environment variable to what he wants (sa 

Related Tutorial and Articles