D
D
DunkanMaklaut2020-07-15 07:52:22
Java
DunkanMaklaut, 2020-07-15 07:52:22

Is it possible to get the name of the account from which they are logged into windows using java?

Is it possible to get the name of the account from which they are logged into windows using java? If yes, please tell me how it can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2020-07-15
@DunkanMaklaut

public static void main(String[] args) {
        String userName = System.getenv("USERNAME");
        System.out.println(userName);
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question