Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button3_Click(object sender, EventArgs e)
- {
- rdp.Focus();
- new Thread(worker).Start();
- }
- void worker()
- {
- LeftMouseClick(Cursor.Position.X - 720, Cursor.Position.Y - 45);
- System.Threading.Thread.Sleep(1000);
- InputSimulator.SimulateTextEntry("cmd");
- System.Threading.Thread.Sleep(1000);
- // Simulate each key stroke
- InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
- System.Threading.Thread.Sleep(1000);
- InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
- System.Threading.Thread.Sleep(1000);
- InputSimulator.SimulateKeyPress(VirtualKeyCode.RETURN);
- System.Threading.Thread.Sleep(1000);
- keybd_event((byte)System.Windows.Forms.Keys.Enter, 0x45, KEYEVENTF_EXTENDEDKEY, 0); //Key down
- keybd_event((byte)System.Windows.Forms.Keys.Enter, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); //Key up
- SendKeys.SendWait("{ENTER}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement