Пример #1
0
        private void LoadWtsInfoProperties()
        {
            var info = Win32Native.QuerySessionInformationForStruct <WTSINFO>(SessionId, WTS_INFO_CLASS.WTSSessionInfo);

            ConnectionState    = info.State;
            IncomingStatistics = new ProtocolStatistics(info.IncomingBytes, info.IncomingFrames, info.IncomingCompressedBytes);
            OutgoingStatistics = new ProtocolStatistics(info.OutgoingBytes, info.OutgoingFrames, info.OutgoingCompressedBytes);
            WindowStationName  = info.WinStationName;
            DomainName         = info.Domain;
            UserName           = info.UserName;
            ConnectTime        = Win32Native.FileTimeToDateTime(info.ConnectTime);
            DisconnectTime     = Win32Native.FileTimeToDateTime(info.DisconnectTime);
            LastInputTime      = Win32Native.FileTimeToDateTime(info.LastInputTime);
            LoginTime          = Win32Native.FileTimeToDateTime(info.LogonTime);
            CurrentTime        = Win32Native.FileTimeToDateTime(info.CurrentTime);
        }
Пример #2
0
        private void LoadWinStationInformationProperties()
        {
            var wsInfo = Win32Native.GetWinStationInformation(SessionId);

            WindowStationName  = wsInfo.WinStationName;
            ConnectionState    = wsInfo.State;
            ConnectTime        = Win32Native.FileTimeToDateTime(wsInfo.ConnectTime);
            CurrentTime        = Win32Native.FileTimeToDateTime(wsInfo.CurrentTime);
            DisconnectTime     = Win32Native.FileTimeToDateTime(wsInfo.DisconnectTime);
            LastInputTime      = Win32Native.FileTimeToDateTime(wsInfo.LastInputTime);
            LoginTime          = Win32Native.FileTimeToDateTime(wsInfo.LoginTime);
            UserName           = wsInfo.UserName;
            DomainName         = wsInfo.Domain;
            IncomingStatistics = new ProtocolStatistics(wsInfo.ProtocolStatus.Input);
            OutgoingStatistics = new ProtocolStatistics(wsInfo.ProtocolStatus.Output);
        }