Пример #1
0
        public void Add(string poste, int posx, int posy)
        {
            VncSharp.RemoteDesktop rd = new VncSharp.RemoteDesktop();

            // Ajoute le bouton à la liste interne de la collection.
            this.List.Add(rd);
            // Ajoute le bouton à la collection de contrôles du formulaire
            // référencé dans le champ HostForm.
            HostForm.Controls.Add(rd);
            //
            // rd
            //
            rd.AutoScroll        = true;
            rd.AutoScrollMinSize = new System.Drawing.Size(150, 112);
            rd.Location          = new System.Drawing.Point(posx * 5, posy * 5);
            rd.Name     = "rd";
            rd.Size     = new System.Drawing.Size(150, 112);
            rd.TabIndex = this.Count;
//			rd.GetPassword = passw;
            try
            {
                rd.Connect(poste, true, true);
            }
            catch (VncProtocolException vex)
            {
            }


/*				System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
 *                              // Crée une nouvelle instance de la classe Button.
 *                              System.Windows.Forms.PictureBox aPicture = new System.Windows.Forms.PictureBox();
 *                              // Ajoute le bouton à la liste interne de la collection.
 *                              this.List.Add(aPicture);
 *                              // Ajoute le bouton à la collection de contrôles du formulaire
 *                              // référencé dans le champ HostForm.
 *                              HostForm.Controls.Add(aPicture);
 *                              // Définit les propriétés initiales de l'objet button.
 *                              aPicture.Image = ((System.Drawing.Image)(resources.GetObject("computer-icon")));
 *                              aPicture.Location = new System.Drawing.Point(posx*5, posy*5);
 *                              aPicture.Name = "Picture " + this.Count.ToString();;
 *                              aPicture.Size = new System.Drawing.Size(70, 60);
 *                              aPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
 *                              aPicture.TabIndex = this.Count;
 *                              aPicture.TabStop = false;
 *                              aPicture.Text = poste;
 *                              aPicture.Click += new System.EventHandler(ClickHandler);*/
        }
Пример #2
0
        public override bool Connect()
        {
            this.connected = false;

            try
            {
                this.rd = new RemoteDesktop
                              {
                                  AutoSizeMode = AutoSizeMode.GrowAndShrink,
                                  AutoSize = true,
                                  AutoScroll = true
                              };

                this.vncPassword = this.Favorite.Credential.Password;

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

                this.Embed(this.rd);

                this.rd.VncPort = this.Favorite.Port;
                this.rd.ConnectComplete += this.rd_ConnectComplete;
                this.rd.ConnectionLost += this.rd_ConnectionLost;
                this.rd.GetPassword = this.VNCPassword;

                if (this.InvokeRequired)
					this.Invoke(new MethodInvoker(delegate { this.Text = "Connecting to VNC server ..."; }));
                else
					this.Text = "Connecting to VNC server ...";

                if (this.rd.InvokeRequired)
                    this.rd.Invoke(new MethodInvoker(delegate { this.rd.Connect(this.Favorite.ServerName, this.Favorite.VncDisplayNumber, this.Favorite.VncViewOnly, this.Favorite.VncAutoScale);  }));
                else
                    this.rd.Connect(this.Favorite.ServerName, this.Favorite.VncDisplayNumber, this.Favorite.VncViewOnly, this.Favorite.VncAutoScale);

                this.rd.BringToFront();
                return this.connected = true;
            }
            catch (Exception exc)
            {
				Log.Error("Error occured while connecting to the VNC server.", exc);
                return this.connected = false;
            }
        }
 public VncClippedDesktopPolicy(VncClient vnc,
                                RemoteDesktop remoteDesktop) 
     : base(vnc, remoteDesktop)
 {
 }
 public VncDesktopTransformPolicy(VncClient vnc,
                                  RemoteDesktop remoteDesktop)
 {
     this.vnc = vnc;
     this.remoteDesktop = remoteDesktop;
 }
Пример #5
0
 public VncDesignModeDesktopPolicy(RemoteDesktop remoteDesktop)
     : base(null, remoteDesktop)
 {
 }
Пример #6
0
 public VncClippedDesktopPolicy(VncClient vnc,
                                RemoteDesktop remoteDesktop)
     : base(vnc, remoteDesktop)
 {
 }
 public VncDesignModeDesktopPolicy(RemoteDesktop remoteDesktop) 
     : base(null, remoteDesktop)
 {
 }
 public VncDesktopTransformPolicy(VncClient vnc,
                                  RemoteDesktop remoteDesktop)
 {
     this.vnc           = vnc;
     this.remoteDesktop = remoteDesktop;
 }
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.rd = new VncSharp.RemoteDesktop();
     this.SuspendLayout();
     //
     // rd
     //
     this.rd.AutoScroll = true;
     this.rd.AutoScrollMinSize = new System.Drawing.Size(608, 427);
     this.rd.Dock = System.Windows.Forms.DockStyle.Fill;
     this.rd.Location = new System.Drawing.Point(0, 0);
     this.rd.Name = "rd";
     this.rd.Size = new System.Drawing.Size(416, 376);
     this.rd.TabIndex = 0;
     this.rd.Text = "remoteDesktop1";
     this.rd.ExceptionEvent += new VncSharp.ExceptionHandler(this.rd_ExceptionEvent);
     this.rd.ConnectionLost += new System.EventHandler(this.rd_ConnectionLost);
     this.rd.ConnectComplete += new VncSharp.ConnectCompleteHandler(this.rd_ConnectComplete);
     //
     // VNCConnectionControl
     //
     this.Controls.Add(this.rd);
     this.Name = "VNCConnectionControl";
     this.Size = new System.Drawing.Size(416, 376);
     this.ResumeLayout(false);
 }
Пример #10
0
        private bool IsPortVNC(Int32 port)
        {
            try
            {
                RemoteDesktop rd = new RemoteDesktop();
                rd.VncPort = port;
                rd.GetPassword = new AuthenticateDelegate(this.GetVNCPassword);
                rd.Connect(this.iPAddress);
                rd.Disconnect();
            }
            catch (CryptographicException ce)
            {
                Logging.Info(string.Empty, ce);
            }
            catch (Exception exc)
            {
                Logging.Error("VNC Port Scan Failed", exc);
                return false;
            }

            return true;
        }