Exemplo n.º 1
2
        public override bool Connect()
        {
            try {
                rd = new VncSharp.RemoteDesktop();
                Controls.Add(rd);

                string pass = Favorite.Password;
                if(pass == null || pass == "") pass = Settings.DefaultPassword;

                this.vncPassword = pass;

                if(pass == null || pass == "") {
                    Terminals.InputBoxResult result = Terminals.InputBox.Show("VNC Password", "Please specify your password now", '*');
                    if(result.ReturnCode == DialogResult.OK) {
                        if(result.Text != null && result.Text != "") {
                            this.vncPassword = result.Text;
                        } else {
                            return false;
                        }
                    } else {
                        return false;
                    }
                }
                //rd.SendSpecialKeys(VncSharp.SpecialKeys);
                rd.Parent = base.TerminalTabPage;
                this.Parent = TerminalTabPage;
                rd.Dock = DockStyle.Fill;
                rd.VncPort = Favorite.Port;

                rd.ConnectComplete += new VncSharp.ConnectCompleteHandler(rd_ConnectComplete);
                rd.ConnectionLost += new EventHandler(rd_ConnectionLost);
                rd.GetPassword = VNCPassword;
                Text = "Connecting to VNC Server...";
                rd.Connect(Favorite.ServerName);
                rd.BringToFront();
                return true;

            } catch(Exception exc) {
                Terminals.Logging.Log.Fatal("Connecting to VNC", exc);
                return false;
            }
        }
Exemplo n.º 2
0
        public override bool Connect()
        {
            try
            {
                rd = new VncSharp.RemoteDesktop();
                Controls.Add(rd);

                string pass = this.Favorite.Security.GetResolvedCredentials().Password;
                this.vncPassword = pass;

                if (string.IsNullOrEmpty(vncPassword)) return false;

                //rd.SendSpecialKeys(VncSharp.SpecialKeys);
                rd.Parent = this.Parent;
                rd.Dock = DockStyle.Fill;

                rd.VncPort = Favorite.Port;
                rd.ConnectComplete += new VncSharp.ConnectCompleteHandler(rd_ConnectComplete);
                rd.ConnectionLost += new EventHandler(rd_ConnectionLost);
                rd.GetPassword = VNCPassword;
                Text = "Connecting to VNC Server...";

                VncOptions options = this.Favorite.ProtocolProperties as VncOptions;
                rd.Connect(Favorite.ServerName, options.DisplayNumber, options.ViewOnly, options.AutoScale);

                rd.BringToFront();
                return true;

            }
            catch (Exception exc)
            {
                Logging.Error("Connecting to VNC", exc);
                return false;
            }
        }
Exemplo n.º 3
0
        public override bool Connect()
        {
            try
            {
                rd = new VncSharp.RemoteDesktop();
                Controls.Add(rd);

                string pass = this.ResolveFavoriteCredentials().Password;
                this.vncPassword = pass;

                rd.Parent = this.Parent;
                rd.Dock   = DockStyle.Fill;

                rd.VncPort          = Favorite.Port;
                rd.ConnectComplete += new VncSharp.ConnectCompleteHandler(rd_ConnectComplete);
                rd.ConnectionLost  += new EventHandler(rd_ConnectionLost);
                rd.GetPassword      = VNCPassword;
                Text = "Connecting to VNC Server...";

                VncOptions options = this.Favorite.ProtocolProperties as VncOptions;
                rd.Connect(Favorite.ServerName, options.DisplayNumber, options.ViewOnly, options.AutoScale);

                rd.BringToFront();
                return(true);
            }
            catch (Exception exc)
            {
                Logging.Error("Connecting to VNC", exc);
                return(false);
            }
        }
Exemplo n.º 4
0
        public override bool Connect()
        {
            try {
                rd = new VncSharp.RemoteDesktop();
                Controls.Add(rd);

                string pass = Favorite.Password;
                if (pass == null || pass == "")
                {
                    pass = Settings.DefaultPassword;
                }

                this.vncPassword = pass;

                if (pass == null || pass == "")
                {
                    Terminals.InputBoxResult result = Terminals.InputBox.Show("VNC Password", "Please specify your password now", '*');
                    if (result.ReturnCode == DialogResult.OK)
                    {
                        if (result.Text != null && result.Text != "")
                        {
                            this.vncPassword = result.Text;
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                //rd.SendSpecialKeys(VncSharp.SpecialKeys);
                rd.Parent   = base.TerminalTabPage;
                this.Parent = TerminalTabPage;
                rd.Dock     = DockStyle.Fill;
                rd.VncPort  = Favorite.Port;


                rd.ConnectComplete += new VncSharp.ConnectCompleteHandler(rd_ConnectComplete);
                rd.ConnectionLost  += new EventHandler(rd_ConnectionLost);
                rd.GetPassword      = VNCPassword;
                Text = "Connecting to VNC Server...";
                rd.Connect(Favorite.ServerName);
                rd.BringToFront();
                return(true);
            } catch (Exception exc) {
                Terminals.Logging.Log.Fatal("Connecting to VNC", exc);
                return(false);
            }
        }
Exemplo n.º 5
0
 void rd_ConnectComplete(object sender, VncSharp.ConnectEventArgs e)
 {
     // Update Form to match geometry of remote desktop
     //ClientSize = new Size(e.DesktopWidth, e.DesktopHeight);
     try {
         connected = true;
         VncSharp.RemoteDesktop rd = (VncSharp.RemoteDesktop)sender;
         rd.Visible = true;
         rd.BringToFront();
         rd.FullScreenUpdate();
         rd.Enabled = true;
     } catch (Exception Exc) {
         Terminals.Logging.Log.Fatal("ConnectComplete to VNC", Exc);
     }
     // Change the Form's title to match desktop name
 }