Beispiel #1
0
 private static void CheckRealService(string ipAddress, int port)
 {
     using (var rd = new RemoteDesktop())
     {
         rd.VncPort     = port;
         rd.GetPassword = new AuthenticateDelegate(() => string.Empty);
         rd.Connect(ipAddress);
         rd.Disconnect();
     }
 }
        private void OpenRemoteDesktop(object sender, EventArgs e)
        {
            var target = _systemManager.GetTargetNetId();

            var ipAddress = AmsRouter.ListRoutes()
                            .Where(route => route.NetId == target)
                            .FirstOrDefault()
                            .Address;

            if (!string.IsNullOrEmpty(ipAddress))
            {
                RemoteDesktop.Connect(ipAddress);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new RemoteDesktop client in charge of logging into the remote server via VNC.
        /// </summary>
        /// <remarks>In case there's already a connected VNC client, this function will return automatically.</remarks>
        private void SetUpVncConnection()
        {
            // If a VNC client is up and running
            if (VncConnected)
            {
                return;
            }

            // If we are tunneling the VNC connection through SSH, connect to "localhost", not remote machine address.
            if (SshConnected && _sshManager.Forward)
            {
                _vncHost = Localhost;
            }

            // Not specifying a display, the target tty will depend on the server port of choice
            _client = new RemoteDesktop(_vncHost, (int)_vncPort, _vncPassword);

            // Connect via VNC
            _client.Connect();
        }