Home Tutorialhelp Comment use NTSystem.getName() instead

 
 

Comment

gle
use NTSystem.getName() instead,
November 21, 2008 at 4:00 AM

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 (say, Administrator),

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Advertisements Advertisements
 

 

 

DMCA.com