Detect user logged on a computer using Java

后端 未结 4 1304
野性不改
野性不改 2020-12-17 01:03

I want to develop an Java application that can detect the user logged on a Window Domain. These credentials are going to be used to logging on the Java application.

4条回答
  •  臣服心动
    2020-12-17 01:46

    If you need to domain name, you can use this :

      com.sun.security.auth.module.NTSystem NTSystem = new
              com.sun.security.auth.module.NTSystem();
      System.out.println(NTSystem.getName());
      System.out.println(NTSystem.getDomain());
    

    Bye.

提交回复
热议问题