0

I am trying to load the Remote app in my windows form panel but i am not able to do it. Currently the remote app opens as a normal remote app. Is there any way I can open this remote app within the windows form.

Here is the code which get triggers when user pressed a button.

private void openProgram()
        {

            Process rdcProcess = new Process();
            rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\cmdkey.exe");
            rdcProcess.StartInfo.Arguments = "/generic:TERMSRV/xyz.domain.com /user:" + "username" + " /pass:" + "password";
            rdcProcess.Start();

            rdcProcess.StartInfo.FileName = Environment.ExpandEnvironmentVariables(@"%SystemRoot%\system32\mstsc.exe");
            rdcProcess.StartInfo.Arguments = @"\\10.10.1.5\myshare\PSTools\Mozilla\RemoteFirefox.rdp";
            rdcProcess.Start();          
        }
Amrit Sharma
  • 1,724
  • 8
  • 41
  • 74

1 Answers1

4

If I understood you question, you want to embed Remote desktop in your form, in this case you can use Microsoft RDP Client Control ActiveX, here is a simple example:

1- Reference Microsoft RDP Client Control:

On Visual Studio Open Toolbox --> Right-Click --> Click Choose Items... --> Select COM Components Tab --> Check Microsoft RDP Client Control (Redistributable)

enter image description here

2-Put RDP Control On Form:

From Toolbox --> Select Microsoft RDP Client Control

OK, We are ready, here is the code for establishing a remote desktop session:

    private void connectButton_Click(object sender, EventArgs e)
    {
        axMsRdpClient81.Server = "192.168.1.100"; //IP address of remote machine
        axMsRdpClient81.Connect();
    }

Here is a screenshot of the example:

enter image description here

user3473830
  • 6,770
  • 5
  • 29
  • 47
  • Thank you for your answer, I am basically looking into open remote app only not the whole remote desktop. Is there any way to do this with the solutions you provided. Like calling some exe in remote compueter. – Amrit Sharma Nov 28 '14 at 12:07