如何使用C#获取登录Windows用户的数量?

编程入门 行业动态 更新时间:2024-10-23 21:39:19
本文介绍了如何使用C#获取登录Windows用户的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我只需要登录Windows的用户数量。状态可以是活动/断开/不活动/退出等,无关紧要。 命令qwinsta显示系统当前用户的详细信息。 我在Linux中知道谁是谁显示网络上的所有用户。 我需要类似的东西来返回用户数。 我有什么试过: 我只能用

I need only the number of users logged in Windows. The state can be active / disconnected / inactive / signed out etc , doesn't matter. Command qwinsta shows details of users currently on the system. I know in Linux its who which displays all the users on the network. I need a similar thing which returns the number of users. What I have tried: I was just able to get the name of the current active user with

QueryComputerSystem("username");

推荐答案

我问谷歌众神:如何获得使用C#登录Windows用户的数量? [ ^ ] - e xact你在这里问过同样的问题。 ...并在几秒钟内发现: c# - 如何获取列表本地Windows用户(仅显示在Windows登录屏幕中的用户) - 堆栈溢出 [ ^ ] I asked the google gods: How do I get the number of logged in windows users with C#?[^] - the exact same question that you asked here. ...and found this within seconds: c# - How can I get a list Local Windows Users (Only the Users that appear in the windows Logon Screen) - Stack Overflow[^]

更多推荐

如何使用C#获取登录Windows用户的数量?

本文发布于:2023-11-06 06:55:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562996.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   数量   用户   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!