如何在 WPF 应用程序中获取登录用户窗口的凭据 [英] How do I get the logged in user's window's credentials in a WPF application

查看:32
本文介绍了如何在 WPF 应用程序中获取登录用户窗口的凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个小应用程序,用于监控提交的票证.它基本上只是坐在角落里,并在新票到达时通知.我需要获取登录计算机的用户名来提取他们的票.

I have a little application I build that monitors tickets submitted. It basically just sits there in the corner and notifies when new tickets arrive. I need to get the persons username who is logged into the computer to pull their tickets.

我尝试搜索,但我认为我使用了错误的术语,因为我真的找不到任何东西.

I tried searching, but I think I'm using the wrong terminology as I couldn't really find anything.

推荐答案

您正在寻找 Environment.UserName 属性.

You're looking for the Environment.UserName property.

您可能还在寻找环境.UserDomainName 属性.

You may also be looking for the Environment.UserDomainName property.

这篇关于如何在 WPF 应用程序中获取登录用户窗口的凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆