private void newConnectionToolStripMenuItem_Click(object sender, EventArgs e) { ConnectionDialog dialog = new ConnectionDialog(); if (dialog.ShowDialog() == DialogResult.OK) { rdpClient = new RdpClient(); rdpClient.Connect(dialog.GetConnectionSettings()); } dialog.Dispose(); }
private void newConnectionToolStripMenuItem_Click(object sender, EventArgs e) { using (ConnectionDialog dialog = new ConnectionDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { var settings = dialog.GetConnectionSettings(); _rdp.Connect(settings.hostname, settings.domain, settings.username, settings.password, settings.port, new FreeRDP.Core.ConnectionSettings() { DesktopWidth = 1920, DesktopHeight = 1080 }); //send enter to dismiss legal notice message Thread.Sleep(2000); _rdp.SendInputKeyboardEvent(KeyboardFlags.KBD_FLAGS_DOWN, 28); Thread.Sleep(200); _rdp.SendInputKeyboardEvent(KeyboardFlags.KBD_FLAGS_RELEASE, 28); UpdateStatusLabel(); } } }