Esempio n. 1
0
        /// <inheritdoc/>
        public virtual void GetChallengeResponse(byte[] challenge, char[] password, byte[] response)
        {
            if (password == null)
            {
                throw new ArgumentNullException(nameof(password));
            }

            var passwordBytes = VncStream.EncodeString(password, 0, password.Length);

            using (new Utility.AutoClear(passwordBytes))
            {
                this.GetChallengeResponse(challenge, passwordBytes, response);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Notifies the server that the local clipboard has changed.
        /// If you are implementing clipboard integration, use this to set the remote clipboard.
        /// </summary>
        /// <param name="data">The contents of the local clipboard.</param>
        public void SendLocalClipboardChange(string data)
        {
            Throw.If.Null(data, "data");

            var bytes = VncStream.EncodeString(data);

            var p = new byte[8 + bytes.Length];

            p[0] = (byte)6;
            VncUtility.EncodeUInt32BE(p, 4, (uint)bytes.Length);
            Array.Copy(bytes, 0, p, 8, bytes.Length);

            if (this.IsConnected)
            {
                this.c.Send(p);
            }
        }