How to get the logged in Host Name & User Details in Java?
import java.net.InetAddress;
String hostName = InetAddress.getLocalHost().getHostName();
To get logged in user name
String user = System.getProperty("user.name");
import java.net.InetAddress;
String hostName = InetAddress.getLocalHost().getHostName();
To get logged in user name
String user = System.getProperty("user.name");
No comments:
Post a Comment