none
Remote application connection RRS feed

  • Question

  • Hi Team,

    We are using Microsoft Terminal Services Active Client 1.0 Type Library to connect to Remote applications in .Net c# and we are not able to connect to remote apps. We are also passing the remote application name and remote application program parameters. Below is the code I'm using to connect. Please provide us a solution to connect to remote applications.

    public void RDPConnect() { connectorRDP.Server = rdpHost; connectorRDP.Domain = rdpDomain; connectorRDP.UserName = rdpUserName; connectorRDP.AdvancedSettings7.RDPPort = rdpPort; if(IsRemote) { try { AxMsRdpClient7NotSafeForScripting rc = new AxMsRdpClient7NotSafeForScripting(); rc.CreateControl(); rc.RemoteProgram2.RemoteProgramMode = true; rc.TransportSettings.GatewayUsageMethod = 2; rc.RemoteProgram2.RemoteApplicationProgram = remoteappprogram; rc.RemoteProgram2.RemoteApplicationName = remoteappname; } catch(Exception ex) { } } connectorRDP.Connect(); }

    Thursday, August 20, 2015 9:27 AM

All replies

  • Hi,

    As far as I know, AxMsRdpClient7NotSafeForScripting used in multi threads. Based on your code, I don't see multi threads. I am curious about why you use AxMsRdpClient7NotSafeForScripting. Here is a related thread. Please refer it for more details.

    Running COM component controls on multiple threads

    We could use AxMSTSCLib, an ActiveX component in our program to connect to the remote computer. It’s not that hard to build a remote desktop application in .NET. Microsoft which has “Microsoft RDP client control” ActiveX control that we will be using in our application.

    Form1.cs
    private void connectBtn_Click(object sender, EventArgs e)
     {
     try
     {
     rdp.Server = serverNametxtB.Text;
     rdp.UserName = usernametxtB.Text;
    
    IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
     secured.ClearTextPassword = pwdtxtB.Text;
     rdp.Connect();
     }
     catch (Exception Ex)
     {
    MessageBox.Show(“Error Connecting”, “Error connecting to remote desktop ” + serverNametxtB.Text + ” Error: ” + Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     }

    Here is an article about some basic operations with AxMSTSCLib.

    Remote Desktop using C#.NET

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Friday, August 21, 2015 3:15 AM
    Friday, August 21, 2015 3:13 AM
  • Thanks for the reply.

    I'm able to connect to remote desktops but i'm not able to connect to remote desktops which has remote application name and remote application program. Please suggest.

    Friday, August 21, 2015 7:04 AM
  • Thanks for the reply.

    I'm able to connect to remote desktops but i'm not able to connect to remote desktops which has remote application name and remote application program. Please suggest.

    Hi

    Do you mean you want to get all applications' name from the remote machine?

    Best regards,

    Kristin 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 25, 2015 8:39 AM
  • For example i want to run Notepad application inside remote desktop. when i run the above code i'm getting a blank screen and it is not connecting to remote desktop also. If i make  rc.RemoteProgram2.RemoteProgramMode = false; it works fine. Please suggest.
    Wednesday, August 26, 2015 9:25 AM
  • For example i want to run Notepad application inside remote desktop. when i run the above code i'm getting a blank screen and it is not connecting to remote desktop also. If i make  rc.RemoteProgram2.RemoteProgramMode = false; it works fine. Please suggest.

    Do you mean if you make  rc.RemoteProgram2.RemoteProgramMode=false will works?

    Have a nice day!

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Kristin Xie Monday, August 31, 2015 2:30 PM
    Monday, August 31, 2015 2:29 PM