gpt4 book ai didi

c# - 使用 wmi 获取事件 session (Win32_LogonSession 也返回非事件/旧 session )

转载 作者:行者123 更新时间:2023-11-30 13:05:02 33 4
gpt4 key购买 nike

有没有办法只显示 wmi 的事件 session ?问题是 Win32_LogonSession 还显示非事件/断开连接的 session 。

ManagementScope scope = new ManagementScope(ManagementPath.DefaultPath);
SelectQuery query = new SelectQuery("Win32_LogonSession");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection results = searcher.Get();
foreach (ManagementObject mo in results)
{
PrintWmiObject(mo);
}

它的输出是这样的

AuthenticationPackage - Kerberos

Caption -

Description -

InstallDate -

LogonId - 10179411

LogonType - 10

Name -

StartTime - 20110617083244.547220+120

Status -

最佳答案

关于:

SelectQuery query = new SelectQuery("Select * from Win32_LogonSession Where LogonType = 10")

关于c# - 使用 wmi 获取事件 session (Win32_LogonSession 也返回非事件/旧 session ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6438515/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com