Java:确定当前Windows用户的程序化方法 [英] Java: Programatic Way to Determine Current Windows User
本文介绍了Java:确定当前Windows用户的程序化方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我看到很多类似的问题,但是我想找到使用Java的当前登录用户的用户名。
I see many similar questions, however I want to find the Username of the currently logged in user using Java.
它可能类似于:
System.getProperty(current.user);
但是,我不太确定。
推荐答案
你真的很亲密。这就是你要找的东西:
You're actually really close. This is what you're looking for:
System.getProperty("user.name")
这篇关于Java:确定当前Windows用户的程序化方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文