RDPSession ConnectToClient Terminating Unexpectedly

江枫思渺然 提交于 2019-12-01 12:50:39

The Microsoft documentation is all wrong regarding reverse connections. Here's what you need to do (adapted from your code above):

RDP Session Side:

RDPSession session = new RDPSession(); 
session.Open(); 
string hostConnString = session.Invitations.CreateInvitation(null, "My Group Name", "12345", 1);

RDPViewer side (note that hostConnString should be the same value as retrieved on the session side):

string viewerConnString = axRDPViewer1.StartReverseConnectListener(hostConnString, "My Name", "12345");

Now back to the RDP session side (note that the viewerConnString should be the same value as retrieved from the viewer side):

session.ConnectToClient(viewerConnString); 

And that should do it. A couple of things to note. The group name specified in CreateInvitation does not need to match anything anywhere else. I think it's just for reference should your program need to enumerate the invitations started by the host. The user name passed to StartReverseConnectListener can also be anything you want. This can be interrogated and used on the host side by looking at the RemoteName property in the IRDPSRAPIAttendee interface.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!