private void button1_Click(object sender, EventArgs e) { rdp.Server = txtServer.Text; rdp.UserName = txtUserName.Text; MSTSCLib.IMsTscNonScriptable secured = (MSTSCLib.IMsTscNonScriptable)rdp.GetOcx(); secured.ClearTextPassword = txtPassword.Text; rdp.Connect(); }
private void button1_Click(object sender, EventArgs e) { Loop(); rdpCtl.Server = textBox1.Text; rdpCtl.UserName = textBox2.Text; MSTSCLib.IMsTscNonScriptable mstscScript = (MSTSCLib.IMsTscNonScriptable)rdpCtl.GetOcx(); mstscScript.ClearTextPassword = textBox3.Text; rdpCtl.Connect(); }
public void CrearComponente(string ip, string pass, string user) { try { TabPage tabPage; AxMSTSCLib.AxMsTscAxNotSafeForScripting remoto; tabPage = new TabPage(); remoto = new AxMSTSCLib.AxMsTscAxNotSafeForScripting(); ComponentResourceManager recursos = new System.ComponentModel.ComponentResourceManager(typeof(RemoteDesktopFH)); ((System.ComponentModel.ISupportInitialize)(remoto)).BeginInit(); tabPage.Controls.Add(remoto); tabPage.Location = new System.Drawing.Point(4, 22); tabPage.Name = listBox1.SelectedItem.ToString(); tabPage.Padding = new System.Windows.Forms.Padding(3); tabPage.Size = new System.Drawing.Size(900, 602); tabPage.TabIndex = 2; tabPage.Text = listBox1.SelectedItem.ToString(); tabPage.UseVisualStyleBackColor = true; // // RDP // remoto.Dock = DockStyle.Fill; remoto.Enabled = true; remoto.Location = new System.Drawing.Point(3, 3); remoto.Name = "RDP"; remoto.OcxState = ((System.Windows.Forms.AxHost.State)(recursos.GetObject("RDP.OcxState"))); remoto.Size = new System.Drawing.Size(894, 596); remoto.TabIndex = 0; this.tabControl1.Controls.Add(tabPage); ((System.ComponentModel.ISupportInitialize)(remoto)).EndInit(); remoto.Server = ip; remoto.UserName = user; MSTSCLib.IMsTscNonScriptable secured = (MSTSCLib.IMsTscNonScriptable)remoto.GetOcx(); secured.ClearTextPassword = pass; remoto.Connect(); } catch (Exception ex) { } }