如何使用C#获取登录Windows用户的数量? [英] How do I get the number of logged in windows users with C#?

查看:428
本文介绍了如何使用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用户的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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