コード例 #1
0
        /// <summary>
        /// Method LoadWtsInfoProperties.
        /// </summary>
        private void LoadWtsInfoProperties()
        {
            var info = NativeMethodsHelper.QuerySessionInformationForStruct <WTSINFO>(this._server.Handle, this._sessionId, WTS_INFO_CLASS.WTSSessionInfo);

            this._connectState.Value       = info.ConnectState;
            this._incomingStatistics.Value = new ProtocolStatistics(info.IncomingBytes, info.IncomingFrames, info.IncomingCompressedBytes);
            this._outgoingStatistics.Value = new ProtocolStatistics(info.OutgoingBytes, info.OutgoingFrames, info.OutgoingCompressedBytes);
            this._windowStationName.Value  = info.WinStationName;
            this._domainName.Value         = info.Domain;
            this._userName.Value           = info.UserName;
            this._connectTime.Value        = NativeMethodsHelper.FileTimeToDateTime(info.ConnectTime);
            this._disconnectTime.Value     = NativeMethodsHelper.FileTimeToDateTime(info.DisconnectTime);
            this._lastInputTime.Value      = NativeMethodsHelper.FileTimeToDateTime(info.LastInputTime);
            this._loginTime.Value          = NativeMethodsHelper.FileTimeToDateTime(info.LogonTime);
            this._currentTime.Value        = NativeMethodsHelper.FileTimeToDateTime(info.CurrentTime);
        }
コード例 #2
0
        /// <summary>
        /// Method GetClientIPAddress.
        /// </summary>
        /// <returns>Client IPAddress.</returns>
        private IPAddress GetClientIPAddress()
        {
            var clientAddress = NativeMethodsHelper.QuerySessionInformationForStruct <WTS_CLIENT_ADDRESS>(this._server.Handle, this._sessionId, WTS_INFO_CLASS.WTSClientAddress);

            return(NativeMethodsHelper.ExtractIPAddress(clientAddress.AddressFamily, clientAddress.Address));
        }
コード例 #3
0
        /// <summary>
        /// Method GetClientDisplay.
        /// </summary>
        /// <returns>Client display.</returns>
        private ClientDisplay GetClientDisplay()
        {
            var clientDisplay = NativeMethodsHelper.QuerySessionInformationForStruct <WTS_CLIENT_DISPLAY>(this._server.Handle, this._sessionId, WTS_INFO_CLASS.WTSClientDisplay);

            return(new ClientDisplay(clientDisplay));
        }