[英]Will Environment.UserName return the same result in Windows 7, Windows 8.x and Windows 10?
I need to get the logged in user's name in a WPF application I'm working on. 我需要在我正在处理的WPF应用程序中获取登录用户的名称。 I've seen this question for a few years back. 几年前我见过这个问题 。 But now I'm wondering about the Environment.UserName command; 但现在我想知道Environment.UserName命令; will it return the same result whether or not it runs on a Windows 7, Windows 8.x or Windows 10 machine? 无论它是否在Windows 7,Windows 8.x或Windows 10计算机上运行,它都会返回相同的结果吗?
根据MSDN ,是的,它会。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.