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();
}
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)
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:
Here is a screenshot of the example: