/// <summary>
        /// Connects this session to an existing session. Both sessions must be running on the local server.
        /// </summary>
        /// <param name="target">The session to which to connect.</param>
        /// <param name="password">The password of the user logged on to the target session. If the user logged on to the target session is the same as the user logged on to this session, this parameter can be an empty string.</param>
        /// <param name="synchronous">true to waits until the operation has completed before returning from the method. false to returns immediately, even though the operation may not be complete yet.</param>
        public void Connect(TerminalServicesSession target, string password, bool synchronous)
        {
            if (!this.IsLocal)
            {
                throw new InvalidOperationException("Cannot connect sessions that are running on remote servers");
            }

            if (IsVistaSp1OrHigher)
            {
                NativeMethodsHelper.Connect(this._sessionId, target.SessionId, password, synchronous);
            }
            else
            {
                NativeMethodsHelper.LegacyConnect(this._server.Handle, this._sessionId, target.SessionId, password, synchronous);
            }
        }