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;
            }
        }
        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;
            }
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
        public override bool Connect()
        {
            SetEventHandlers();

            try
            {
                _VNC.Connect(Info.Hostname, Info.VNCViewOnly, Info.VNCSmartSizeMode != SmartSizeMode.SmartSNo);
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strConnectionOpenFailed + Environment.NewLine + ex.Message);
                return(false);
            }

            return(true);
        }
        public override bool Connect()
        {
            this.SetEventHandlers();

            try
            {
                VNC_Client.Connect((string)this.Info.Hostname, System.Convert.ToBoolean(this.Info.VNCViewOnly),
                                   System.Convert.ToBoolean(Info.VNCSmartSizeMode != SmartSizeMode.SmartSNo));
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                    Language.strVncConnectionOpenFailed + Constants.vbNewLine +
                                                    ex.Message);
                return(false);
            }

            return(true);
        }
 private bool IsPortVNC()
 {
     try {
         lock (vncConnection) {
             VncSharp.RemoteDesktop rd = new VncSharp.RemoteDesktop();
             rd.VncPort     = Port;
             rd.GetPassword = new VncSharp.AuthenticateDelegate(VNCPassword);
             rd.Connect(IPAddress);
             rd.Disconnect();
         }
         return(true);
     }catch (System.Security.Cryptography.CryptographicException ce) {
         Terminals.Logging.Log.Info("", ce);
         return(true);
     } catch (Exception exc) {
         Terminals.Logging.Log.Info("", exc);
         exc.ToString();
     }
     return(false);
 }
 private bool IsPortVNC()
 {
     try {
         lock (vncConnection) {
             VncSharp.RemoteDesktop rd = new VncSharp.RemoteDesktop();
             rd.VncPort = Port;
             rd.GetPassword = new VncSharp.AuthenticateDelegate(VNCPassword);
             rd.Connect(IPAddress);
             rd.Disconnect();
         }
         return true;
     }catch(System.Security.Cryptography.CryptographicException ce) {
         Terminals.Logging.Log.Info("", ce);
         return true;
     } catch (Exception exc) {
         Terminals.Logging.Log.Info("", exc);
         exc.ToString();
     }
     return false;
 }