【发布时间】:2015-09-28 21:30:37
【问题描述】:
我需要确定当前用户是否是 RDP 会话,这很简单,但我需要知道会话是否使用“/admin”标志启动。 过去我使用 Session Id,它是 0,但现在在较新的 Windows 版本上它不再是 0。
【问题讨论】:
我需要确定当前用户是否是 RDP 会话,这很简单,但我需要知道会话是否使用“/admin”标志启动。 过去我使用 Session Id,它是 0,但现在在较新的 Windows 版本上它不再是 0。
【问题讨论】:
也许,这就是你需要的:
[DllImport("Kernel32.dll", SetLastError = true)]
[return:MarshalAs(UnmanagedType.U4)]
public static extern int WTSGetActiveConsoleSessionId ( );
【讨论】: