Guest User

Untitled

a guest
Sep 10th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. AxMSTSCLib and Process Enumeration
  2. AxMSTSCLib.AxMsRdpClient6NotSafeForScripting _oRDPClient = null;
  3. int liHeight = Screen.PrimaryScreen.Bounds.Height;
  4. int liWidth = Screen.PrimaryScreen.Bounds.Width;
  5. this.Size = new System.Drawing.Size(liWidth + 40, liHeight);
  6. try
  7. {
  8. _oRDPClient = new AxMSTSCLib.AxMsRdpClient6NotSafeForScripting();
  9. ((ISupportInitialize)_oRDPClient).BeginInit();
  10. _oRDPClient.Enabled = true;
  11. _oRDPClient.Visible = false;
  12. _oRDPClient.Location = new System.Drawing.Point(0, 0);
  13. _oRDPClient.Name = "MsRdpClient";
  14. _oRDPClient.Size = ClientSize;
  15. _oRDPClient.Dock = DockStyle.Fill;
  16. _oRDPClient.TabIndex = 1;
  17. Controls.Add(_oRDPClient);
  18. ((ISupportInitialize)_oRDPClient).EndInit();
  19. _oRDPClient.Server = "201.152.90.41";
  20. _oRDPClient.UserName = "user1";
  21. _oRDPClient.AdvancedSettings7.ClearTextPassword = "password123";
  22. _oRDPClient.Domain = "";
  23. _oRDPClient.RemoteProgram.RemoteProgramMode = true;
  24.  
  25. _oRDPClient.AdvancedSettings7.RDPPort = 6384;
  26. _oRDPClient.AdvancedSettings7.RedirectDrives = false;
  27. _oRDPClient.AdvancedSettings7.RedirectPrinters = false;
  28. _oRDPClient.AdvancedSettings7.RedirectPorts = false;
  29. _oRDPClient.AdvancedSettings7.RedirectSmartCards = false;
  30. _oRDPClient.AdvancedSettings7.RedirectClipboard = true;
  31. _oRDPClient.AdvancedSettings7.MinutesToIdleTimeout = 1;
  32. _oRDPClient.AdvancedSettings7.AuthenticationLevel = 0;
  33. _oRDPClient.AdvancedSettings7.DisableRdpdr = 0;
  34. _oRDPClient.AdvancedSettings7.DisplayConnectionBar = true;
  35. _oRDPClient.AdvancedSettings7.PublicMode = false;
  36. _oRDPClient.AdvancedSettings7.SmartSizing = true;
  37.  
  38. _oRDPClient.Connect();
  39. _oRDPClient.RemoteProgram.ServerStartProgram(@"C:MyAppsApp1.exe", "", @"C:MyApps", false, "username password", false);
  40. }
  41. catch
  42. {
  43. MessageBox.Show("Unable to start RDP.");
  44. }
Add Comment
Please, Sign In to add comment