简体   繁体   English

Environment.UserName会在Windows 7,Windows 8.x和Windows 10中返回相同的结果吗?

[英]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.

相关问题 在 Windows 服务中使用时 Environment.UserName 会返回什么 - What would Environment.UserName return when used in a Windows Service 针对Windows 8.x的.Net 4.0 - .Net 4.0 targeting on windows 8.x Windows 10 x:绑定到SelectedItem - Windows 10 x:Bind to SelectedItem 在Windows 10 C#UWP通用Windows应用程序中获取UserName - Get UserName in a Windows 10 C# UWP Universal Windows app Environment.UserName 为同一用户(外壳)提供不同的结果:替代/转换? - Environment.UserName gives different results for same user (casing): alternative/transformation? Environment.UserName 返回应用程序池名称而不是用户名 - Environment.UserName returning application pool name instead of username Windows身份验证-获取Windows用户名 - Windows Authentication - Get windows username 在Windows Phone 8.x项目中找不到UserControl:“名称空间中不存在类型或名称空间名称'UserControls'” - UserControl in Windows Phone 8.x project can't be found: “The type or namespace name 'UserControls' does not exist in the namespace” 如何确定 Windows 应用程序 (UWP / PC/Tablet 8.1 / Mobile 8.x) 的操作系统 (OS)? - How to Determine the Operating System (OS) for a Windows App (UWP / PC/Tablet 8.1 / Mobile 8.x)? 使用C#在Windows Phone 8.x上为自定义Smartwatch创建通知处理应用 - Creating a Notification-Handling App for a Custom Smartwatch on Windows Phone 8.x using C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM