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; } }
private void CheckVnc() { pnlCheck2.Visible = true; try { using (var vnc = new VncSharp.RemoteDesktop()) { vnc.CreateControl(); while (!vnc.Created) { Thread.Sleep(10); System.Windows.Forms.Application.DoEvents(); } pbCheck2.Image = Resources.Good_Symbol; lblCheck2.ForeColor = Color.DarkOliveGreen; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckSucceeded; txtCheck2.Text = string.Format(Language.strCcVNCOK, vnc.ProductVersion); Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "VNC installed", true); } } catch (Exception) { pbCheck2.Image = Resources.Bad_Symbol; lblCheck2.ForeColor = Color.Firebrick; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckFailed; txtCheck2.Text = Language.strCcVNCFailed; Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, "VNC " + Language.strCcNotInstalledProperly, true); } }
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.AutoSize = true; 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(856, 576); this.rd.TabIndex = 1; // // Form2 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1025, 790); this.Controls.Add(this.rd); this.Name = "Form2"; this.Text = "Form2"; this.ResumeLayout(false); this.PerformLayout(); }
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); } }
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; } }
public NagishClient( VncSharp.RemoteDesktop rdControl, string hostIP) { //rdControl is the RemoteDesktop control instance that will be used with this class. //hostIP is the... well, the IP of the host. :D this.disconnected = true; this.rd = rdControl; this.hostIP = hostIP; this.retries = 0; this.codeToSend = this.CONNECTEDCODE; this.rd.ConnectionLost += new EventHandler(this.ConnectionLost); }
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); } }
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 }
public override bool Initialize() { base.Initialize(); try { _VNC = (VncSharp.RemoteDesktop)Control; Info = InterfaceControl.Info; _VNC.VncPort = Info.Port; return(true); } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetPropsFailed + Environment.NewLine + ex.Message, true); 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); }
public static bool IsVNCOk() { try { using (var VNC = new VncSharp.RemoteDesktop()) { VNC.CreateControl(); var i = 60; while (!VNC.Created && i-- > 0) { Thread.Sleep(10); Application.DoEvents(); } VNCVer = VNC.ProductVersion; } return(true); } catch (Exception) { return(false); } }
public static bool IsVNCOk() { try { using (var VNC = new VncSharp.RemoteDesktop()) { VNC.CreateControl(); var i = 60; while (!VNC.Created && i-- > 0) { Thread.Sleep(10); Application.DoEvents(); } VNCVer = VNC.ProductVersion; } return true; } catch (Exception) { return false; } }
public override bool SetProps() { base.SetProps(); try { VNC_Client = (VncSharp.RemoteDesktop)this.Control; Info = this.InterfaceControl.Info; VNC_Client.VncPort = System.Convert.ToInt32(this.Info.Port); //If Info.VNCCompression <> Compression.CompNone Then // VNC.JPEGCompression = True // VNC.JPEGCompressionLevel = Info.VNCCompression //End If //Select Case Info.VNCEncoding // Case Encoding.EncCorre // VNC.Encoding = ViewerX.VNCEncoding.RFB_CORRE // Case Encoding.EncHextile // VNC.Encoding = ViewerX.VNCEncoding.RFB_HEXTILE // Case Encoding.EncRaw // VNC.Encoding = ViewerX.VNCEncoding.RFB_RAW // Case Encoding.EncRRE // VNC.Encoding = ViewerX.VNCEncoding.RFB_RRE // Case Encoding.EncTight // VNC.Encoding = ViewerX.VNCEncoding.RFB_TIGHT // Case Encoding.EncZlib // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZLIB // Case Encoding.EncZLibHex // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZLIBHEX // Case Encoding.EncZRLE // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZRLE //End Select //If Info.VNCAuthMode = AuthMode.AuthWin Then // VNC.LoginType = ViewerX.ViewerLoginType.VLT_MSWIN // VNC.MsUser = Me.Info.Username // VNC.MsDomain = Me.Info.Domain // VNC.MsPassword = Me.Info.Password //Else // VNC.LoginType = ViewerX.ViewerLoginType.VLT_VNC // VNC.Password = Me.Info.Password //End If //Select Case Info.VNCProxyType // Case ProxyType.ProxyNone // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_NONE // Case ProxyType.ProxyHTTP // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_HTTP // Case ProxyType.ProxySocks5 // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_SOCKS5 // Case ProxyType.ProxyUltra // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_ULTRA_REPEATER //End Select //If Info.VNCProxyType <> ProxyType.ProxyNone Then // VNC.ProxyIP = Info.VNCProxyIP // VNC.ProxyPort = Info.VNCProxyPort // VNC.ProxyUser = Info.VNCProxyUsername // VNC.ProxyPassword = Info.VNCProxyPassword //End If //If Info.VNCColors = Colors.Col8Bit Then // VNC.RestrictPixel = True //Else // VNC.RestrictPixel = False //End If //VNC.ConnectingText = Language.strInheritConnecting & " (SmartCode VNC viewer)" //VNC.DisconnectedText = Language.strInheritDisconnected //VNC.MessageBoxes = False //VNC.EndInit() return true; } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetPropsFailed + Constants.vbNewLine + ex.Message, true); return false; } }
public override bool Initialize() { base.Initialize(); try { _VNC = (VncSharp.RemoteDesktop) this.Control; Info = this.InterfaceControl.Info; _VNC.VncPort = this.Info.Port; //If Info.VNCCompression <> Compression.CompNone Then // VNC.JPEGCompression = True // VNC.JPEGCompressionLevel = Info.VNCCompression //End If //Select Case Info.VNCEncoding // Case Encoding.EncCorre // VNC.Encoding = ViewerX.VNCEncoding.RFB_CORRE // Case Encoding.EncHextile // VNC.Encoding = ViewerX.VNCEncoding.RFB_HEXTILE // Case Encoding.EncRaw // VNC.Encoding = ViewerX.VNCEncoding.RFB_RAW // Case Encoding.EncRRE // VNC.Encoding = ViewerX.VNCEncoding.RFB_RRE // Case Encoding.EncTight // VNC.Encoding = ViewerX.VNCEncoding.RFB_TIGHT // Case Encoding.EncZlib // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZLIB // Case Encoding.EncZLibHex // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZLIBHEX // Case Encoding.EncZRLE // VNC.Encoding = ViewerX.VNCEncoding.RFB_ZRLE //End Select //If Info.VNCAuthMode = AuthMode.AuthWin Then // VNC.LoginType = ViewerX.ViewerLoginType.VLT_MSWIN // VNC.MsUser = Me.Info.Username // VNC.MsDomain = Me.Info.Domain // VNC.MsPassword = Me.Info.Password //Else // VNC.LoginType = ViewerX.ViewerLoginType.VLT_VNC // VNC.Password = Me.Info.Password //End If //Select Case Info.VNCProxyType // Case ProxyType.ProxyNone // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_NONE // Case ProxyType.ProxyHTTP // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_HTTP // Case ProxyType.ProxySocks5 // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_SOCKS5 // Case ProxyType.ProxyUltra // VNC.ProxyType = ViewerX.ConnectionProxyType.VPT_ULTRA_REPEATER //End Select //If Info.VNCProxyType <> ProxyType.ProxyNone Then // VNC.ProxyIP = Info.VNCProxyIP // VNC.ProxyPort = Info.VNCProxyPort // VNC.ProxyUser = Info.VNCProxyUsername // VNC.ProxyPassword = Info.VNCProxyPassword //End If //If Info.VNCColors = Colors.Col8Bit Then // VNC.RestrictPixel = True //Else // VNC.RestrictPixel = False //End If //VNC.ConnectingText = Language.strInheritConnecting & " (SmartCode VNC viewer)" //VNC.DisconnectedText = Language.strInheritDisconnected //VNC.MessageBoxes = False //VNC.EndInit() return(true); } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetPropsFailed + Environment.NewLine + ex.Message, true); return(false); } }
public override bool Initialize() { base.Initialize(); try { _VNC = (VncSharp.RemoteDesktop)Control; Info = InterfaceControl.Info; _VNC.VncPort = Info.Port; return true; } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strVncSetPropsFailed + Environment.NewLine + ex.Message, true); return false; } }
public ProtocolVNC() { Control = new VncSharp.RemoteDesktop(); }
public ProtocolVNC() { Control = new VncSharp.RemoteDesktop(); }
private void CheckVnc() { pnlCheck2.Visible = true; try { using (var vnc = new VncSharp.RemoteDesktop()) { vnc.CreateControl(); while (!vnc.Created) { Thread.Sleep(10); System.Windows.Forms.Application.DoEvents(); } pbCheck2.Image = Resources.Good_Symbol; lblCheck2.ForeColor = Color.DarkOliveGreen; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckSucceeded; txtCheck2.Text = string.Format(Language.strCcVNCOK, vnc.ProductVersion); Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "VNC installed", true); } } catch (Exception) { pbCheck2.Image = Resources.Bad_Symbol; lblCheck2.ForeColor = Color.Firebrick; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckFailed; txtCheck2.Text = Language.strCcVNCFailed; Runtime.MessageCollector.AddMessage(MessageClass.WarningMsg, "VNC " + Language.strCcNotInstalledProperly, true); } }
private void CheckComponents() { string errorMsg = Language.strCcNotInstalledProperly; pnlCheck1.Visible = true; pnlCheck2.Visible = true; pnlCheck3.Visible = true; pnlCheck4.Visible = true; pnlCheck5.Visible = true; AxMSTSCLib.AxMsRdpClient5NotSafeForScripting rdpClient = null; try { rdpClient = new AxMSTSCLib.AxMsRdpClient5NotSafeForScripting(); rdpClient.CreateControl(); while (!rdpClient.Created) { Thread.Sleep(0); System.Windows.Forms.Application.DoEvents(); } if (!(new Version(Convert.ToString(rdpClient.Version)) >= ProtocolRDP.Versions.RDC80)) { throw (new Exception(string.Format("Found RDC Client version {0} but version {1} or higher is required.", rdpClient.Version, ProtocolRDP.Versions.RDC80))); } pbCheck1.Image = Resources.Good_Symbol; lblCheck1.ForeColor = Color.DarkOliveGreen; lblCheck1.Text = "RDP (Remote Desktop) " + Language.strCcCheckSucceeded; txtCheck1.Text = string.Format(Language.strCcRDPOK, rdpClient.Version); } catch (Exception ex) { pbCheck1.Image = Resources.Bad_Symbol; lblCheck1.ForeColor = Color.Firebrick; lblCheck1.Text = "RDP (Remote Desktop) " + Language.strCcCheckFailed; txtCheck1.Text = Language.strCcRDPFailed; Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "RDP " + errorMsg, true); Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, ex.Message, true); } if (rdpClient != null) { rdpClient.Dispose(); } VncSharp.RemoteDesktop VNC = null; try { VNC = new VncSharp.RemoteDesktop(); VNC.CreateControl(); while (!VNC.Created) { Thread.Sleep(10); System.Windows.Forms.Application.DoEvents(); } pbCheck2.Image = Resources.Good_Symbol; lblCheck2.ForeColor = Color.DarkOliveGreen; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckSucceeded; txtCheck2.Text = string.Format(Language.strCcVNCOK, VNC.ProductVersion); } catch (Exception) { pbCheck2.Image = Resources.Bad_Symbol; lblCheck2.ForeColor = Color.Firebrick; lblCheck2.Text = "VNC (Virtual Network Computing) " + Language.strCcCheckFailed; txtCheck2.Text = Language.strCcVNCFailed; Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "VNC " + errorMsg, true); } if (VNC != null) { VNC.Dispose(); } string pPath = ""; if (Settings.Default.UseCustomPuttyPath == false) { pPath = GeneralAppInfo.HomePath + "\\PuTTYNG.exe"; } else { pPath = Convert.ToString(Settings.Default.CustomPuttyPath); } if (File.Exists(pPath)) { pbCheck3.Image = Resources.Good_Symbol; lblCheck3.ForeColor = Color.DarkOliveGreen; lblCheck3.Text = "PuTTY (SSH/Telnet/Rlogin/RAW) " + Language.strCcCheckSucceeded; txtCheck3.Text = Language.strCcPuttyOK; } else { pbCheck3.Image = Resources.Bad_Symbol; lblCheck3.ForeColor = Color.Firebrick; lblCheck3.Text = "PuTTY (SSH/Telnet/Rlogin/RAW) " + Language.strCcCheckFailed; txtCheck3.Text = Language.strCcPuttyFailed; Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "PuTTY " + errorMsg, true); Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "File " + pPath + " does not exist.", true); } AxWFICALib.AxICAClient ICA = null; try { ICA = new AxWFICALib.AxICAClient(); ICA.Parent = this; ICA.CreateControl(); while (!ICA.Created) { Thread.Sleep(10); System.Windows.Forms.Application.DoEvents(); } pbCheck4.Image = Resources.Good_Symbol; lblCheck4.ForeColor = Color.DarkOliveGreen; lblCheck4.Text = "ICA (Citrix ICA) " + Language.strCcCheckSucceeded; txtCheck4.Text = string.Format(Language.strCcICAOK, ICA.Version); } catch (Exception ex) { pbCheck4.Image = Resources.Bad_Symbol; lblCheck4.ForeColor = Color.Firebrick; lblCheck4.Text = "ICA (Citrix ICA) " + Language.strCcCheckFailed; txtCheck4.Text = Language.strCcICAFailed; Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "ICA " + errorMsg, true); Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, ex.Message, true); } if (ICA != null) { ICA.Dispose(); } bool GeckoBad = false; var GeckoFxPath = Path.Combine(GeneralAppInfo.HomePath, "Firefox"); if (File.Exists(Path.Combine(GeneralAppInfo.HomePath, "Geckofx-Core.dll"))) { if (Directory.Exists(GeckoFxPath)) { if (!File.Exists(Path.Combine(GeckoFxPath, "xul.dll"))) { GeckoBad = true; } } else { GeckoBad = true; } } if (GeckoBad == false) { pbCheck5.Image = Resources.Good_Symbol; lblCheck5.ForeColor = Color.DarkOliveGreen; lblCheck5.Text = "Gecko (Firefox) Rendering Engine (HTTP/S) " + Language.strCcCheckSucceeded; if (!Xpcom.IsInitialized) { Xpcom.Initialize("Firefox"); } txtCheck5.Text = Language.strCcGeckoOK + " Version: " + Xpcom.XulRunnerVersion; } else { pbCheck5.Image = Resources.Bad_Symbol; lblCheck5.ForeColor = Color.Firebrick; lblCheck5.Text = "Gecko (Firefox) Rendering Engine (HTTP/S) " + Language.strCcCheckFailed; txtCheck5.Text = Language.strCcGeckoFailed; Runtime.MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "Gecko " + errorMsg, true); Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "GeckoFx was not found in " + GeckoFxPath, true); } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.disconnectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clippedViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.scaledViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); this.fullScreenRefreshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sendKeysToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cTRLALTDELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aLTF4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cTRLESCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cTRLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aLTToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rd = new VncSharp.RemoteDesktop(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.viewToolStripMenuItem, this.editToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(724, 24); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.connectToolStripMenuItem, this.disconnectToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; // // connectToolStripMenuItem // this.connectToolStripMenuItem.Name = "connectToolStripMenuItem"; this.connectToolStripMenuItem.Size = new System.Drawing.Size(133, 22); this.connectToolStripMenuItem.Text = "&Connect..."; this.connectToolStripMenuItem.Click += new System.EventHandler(this.connectToolStripMenuItem_Click); // // disconnectToolStripMenuItem // this.disconnectToolStripMenuItem.Enabled = false; this.disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem"; this.disconnectToolStripMenuItem.Size = new System.Drawing.Size(133, 22); this.disconnectToolStripMenuItem.Text = "&Disconnect"; this.disconnectToolStripMenuItem.Click += new System.EventHandler(this.disconnectToolStripMenuItem_Click); // // viewToolStripMenuItem // this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.clippedViewToolStripMenuItem, this.scaledViewToolStripMenuItem, this.toolStripMenuItem2, this.fullScreenRefreshToolStripMenuItem, this.viewOnlyToolStripMenuItem}); this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.viewToolStripMenuItem.Text = "&View"; // // clippedViewToolStripMenuItem // this.clippedViewToolStripMenuItem.Checked = true; this.clippedViewToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.clippedViewToolStripMenuItem.Name = "clippedViewToolStripMenuItem"; this.clippedViewToolStripMenuItem.Size = new System.Drawing.Size(173, 22); this.clippedViewToolStripMenuItem.Text = "C&lipped View"; this.clippedViewToolStripMenuItem.Click += new System.EventHandler(this.clippedViewToolStripMenuItem_Click); // // scaledViewToolStripMenuItem // this.scaledViewToolStripMenuItem.Name = "scaledViewToolStripMenuItem"; this.scaledViewToolStripMenuItem.Size = new System.Drawing.Size(173, 22); this.scaledViewToolStripMenuItem.Text = "Sc&aled View"; this.scaledViewToolStripMenuItem.Click += new System.EventHandler(this.scaledViewToolStripMenuItem_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(170, 6); // // fullScreenRefreshToolStripMenuItem // this.fullScreenRefreshToolStripMenuItem.Enabled = false; this.fullScreenRefreshToolStripMenuItem.Name = "fullScreenRefreshToolStripMenuItem"; this.fullScreenRefreshToolStripMenuItem.Size = new System.Drawing.Size(173, 22); this.fullScreenRefreshToolStripMenuItem.Text = "Full Screen Refresh"; this.fullScreenRefreshToolStripMenuItem.Click += new System.EventHandler(this.fullScreenRefreshToolStripMenuItem_Click); // // viewOnlyToolStripMenuItem // this.viewOnlyToolStripMenuItem.Name = "viewOnlyToolStripMenuItem"; this.viewOnlyToolStripMenuItem.Size = new System.Drawing.Size(173, 22); this.viewOnlyToolStripMenuItem.Text = "View Only"; this.viewOnlyToolStripMenuItem.Click += new System.EventHandler(this.viewOnlyToolStripMenuItem_Click); // // editToolStripMenuItem // this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.sendKeysToolStripMenuItem, this.pasteToolStripMenuItem}); this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Text = "&Edit"; // // sendKeysToolStripMenuItem // this.sendKeysToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cTRLALTDELToolStripMenuItem, this.aLTF4ToolStripMenuItem, this.cTRLESCToolStripMenuItem, this.cTRLToolStripMenuItem, this.aLTToolStripMenuItem}); this.sendKeysToolStripMenuItem.Name = "sendKeysToolStripMenuItem"; this.sendKeysToolStripMenuItem.Size = new System.Drawing.Size(223, 22); this.sendKeysToolStripMenuItem.Text = "Send Keys"; // // cTRLALTDELToolStripMenuItem // this.cTRLALTDELToolStripMenuItem.Enabled = false; this.cTRLALTDELToolStripMenuItem.Name = "cTRLALTDELToolStripMenuItem"; this.cTRLALTDELToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.cTRLALTDELToolStripMenuItem.Text = "CTRL + ALT + DEL"; this.cTRLALTDELToolStripMenuItem.Click += new System.EventHandler(this.cTRLALTDELToolStripMenuItem_Click); // // aLTF4ToolStripMenuItem // this.aLTF4ToolStripMenuItem.Enabled = false; this.aLTF4ToolStripMenuItem.Name = "aLTF4ToolStripMenuItem"; this.aLTF4ToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.aLTF4ToolStripMenuItem.Text = "ALT + F4"; this.aLTF4ToolStripMenuItem.Click += new System.EventHandler(this.aLTF4ToolStripMenuItem_Click); // // cTRLESCToolStripMenuItem // this.cTRLESCToolStripMenuItem.Enabled = false; this.cTRLESCToolStripMenuItem.Name = "cTRLESCToolStripMenuItem"; this.cTRLESCToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.cTRLESCToolStripMenuItem.Text = "CTRL + ESC"; this.cTRLESCToolStripMenuItem.Click += new System.EventHandler(this.cTRLESCToolStripMenuItem_Click); // // cTRLToolStripMenuItem // this.cTRLToolStripMenuItem.Enabled = false; this.cTRLToolStripMenuItem.Name = "cTRLToolStripMenuItem"; this.cTRLToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.cTRLToolStripMenuItem.Text = "CTRL"; this.cTRLToolStripMenuItem.Click += new System.EventHandler(this.cTRLToolStripMenuItem_Click); // // aLTToolStripMenuItem // this.aLTToolStripMenuItem.Enabled = false; this.aLTToolStripMenuItem.Name = "aLTToolStripMenuItem"; this.aLTToolStripMenuItem.Size = new System.Drawing.Size(171, 22); this.aLTToolStripMenuItem.Text = "ALT"; this.aLTToolStripMenuItem.Click += new System.EventHandler(this.aLTToolStripMenuItem_Click); // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.Enabled = false; this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; this.pasteToolStripMenuItem.Size = new System.Drawing.Size(223, 22); this.pasteToolStripMenuItem.Text = "Copy local clipboard to host"; this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); // // rd // this.rd.AutoScroll = true; this.rd.AutoScrollMinSize = new System.Drawing.Size(608, 427); this.rd.AutoSize = true; this.rd.Location = new System.Drawing.Point(0, 27); this.rd.Name = "rd"; this.rd.Size = new System.Drawing.Size(724, 546); this.rd.TabIndex = 1; // // VncSharpViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(724, 575); this.Controls.Add(this.rd); this.Controls.Add(this.menuStrip1); this.MainMenuStrip = this.menuStrip1; this.Name = "VncSharpViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "VncSharp Client Example"; this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
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; }