Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AxMSTSCLib and Process Enumeration
- AxMSTSCLib.AxMsRdpClient6NotSafeForScripting _oRDPClient = null;
- int liHeight = Screen.PrimaryScreen.Bounds.Height;
- int liWidth = Screen.PrimaryScreen.Bounds.Width;
- this.Size = new System.Drawing.Size(liWidth + 40, liHeight);
- try
- {
- _oRDPClient = new AxMSTSCLib.AxMsRdpClient6NotSafeForScripting();
- ((ISupportInitialize)_oRDPClient).BeginInit();
- _oRDPClient.Enabled = true;
- _oRDPClient.Visible = false;
- _oRDPClient.Location = new System.Drawing.Point(0, 0);
- _oRDPClient.Name = "MsRdpClient";
- _oRDPClient.Size = ClientSize;
- _oRDPClient.Dock = DockStyle.Fill;
- _oRDPClient.TabIndex = 1;
- Controls.Add(_oRDPClient);
- ((ISupportInitialize)_oRDPClient).EndInit();
- _oRDPClient.Server = "201.152.90.41";
- _oRDPClient.UserName = "user1";
- _oRDPClient.AdvancedSettings7.ClearTextPassword = "password123";
- _oRDPClient.Domain = "";
- _oRDPClient.RemoteProgram.RemoteProgramMode = true;
- _oRDPClient.AdvancedSettings7.RDPPort = 6384;
- _oRDPClient.AdvancedSettings7.RedirectDrives = false;
- _oRDPClient.AdvancedSettings7.RedirectPrinters = false;
- _oRDPClient.AdvancedSettings7.RedirectPorts = false;
- _oRDPClient.AdvancedSettings7.RedirectSmartCards = false;
- _oRDPClient.AdvancedSettings7.RedirectClipboard = true;
- _oRDPClient.AdvancedSettings7.MinutesToIdleTimeout = 1;
- _oRDPClient.AdvancedSettings7.AuthenticationLevel = 0;
- _oRDPClient.AdvancedSettings7.DisableRdpdr = 0;
- _oRDPClient.AdvancedSettings7.DisplayConnectionBar = true;
- _oRDPClient.AdvancedSettings7.PublicMode = false;
- _oRDPClient.AdvancedSettings7.SmartSizing = true;
- _oRDPClient.Connect();
- _oRDPClient.RemoteProgram.ServerStartProgram(@"C:MyAppsApp1.exe", "", @"C:MyApps", false, "username password", false);
- }
- catch
- {
- MessageBox.Show("Unable to start RDP.");
- }
Add Comment
Please, Sign In to add comment