private void toolStripButton3_Click(object sender, EventArgs e) { if (treeView1.SelectedNode != null) { if (treeView1.SelectedNode.Tag.ToString() == "Folder") { разъединитьToolStripMenuItem_Click(sender, e); соединитьсяToolStripMenuItem_Click(sender, e); } else { /*соединитьсяToolStripMenuItem1_Click(sender, e); * MessageBox.Show("Disconnected"); * соединитьсяToolStripMenuItem1_Click(sender, e);*/ /*AxMSTSCLib.AxMsRdpClientNotSafeForScripting*/ myRDP rc = (/*AxMSTSCLib.AxMsRdpClientNotSafeForScripting*/ myRDP)treeView1.SelectedNode.Tag; if (rc.Connected != 0) { rc.Disconnect(); } if (rc.Connected == 0) { rc.Connect(); } } } }
private void AddRDP(TreeNode server) { AxMSTSCLib.AxMsRdpClientNotSafeForScripting RDPCl = new myRDP();//AxMSTSCLib.AxMsRdpClientNotSafeForScripting(); RDPCl.Name = server.Text; panel4.Controls.Add(RDPCl); RDPCl.Dock = DockStyle.Fill; RDPCl.Tag = server; server.Tag = RDPCl; RDPCl.OnConnected += new System.EventHandler(RDPCl_OnConnected); RDPCl.OnDisconnected += new AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEventHandler(RDPCl_OnDisconnected); //return RDPCl; }
private void справкаToolStripMenuItem_Click(object sender, EventArgs e) { /*for (int i = 0; i < panel5.Controls.Count; i++) * { * Bitmap pict = new Bitmap(panel5.Controls[i].Width, panel5.Controls[i].Height); * * panel5.Controls[i].DrawToBitmap(pict, panel5.Controls[i].Bounds); * pict.Save("c:\\rdp\\" + panel5.Controls[i].Name + ".bmp"); * }*/ for (int i = 0; i < panel5.Controls.Count; i++) { /*AxMSTSCLib.AxMsRdpClientNotSafeForScripting*/ myRDP thumb = (/*AxMSTSCLib.AxMsRdpClientNotSafeForScripting*/ myRDP)panel5.Controls[i]; Bitmap bmp = new Bitmap(thumb.Width, thumb.Height); thumb.DrawToBitmap(bmp, new Rectangle(0, 0, thumb.Width, thumb.Height)); bmp.Save("c:\\temp\\" + thumb.Name + ".bmp"); MessageBox.Show(thumb.Name); } }