小编mVi*_*ent的帖子

使用RDP 8.0的C#自定义远程桌面客户端

我已经在MSDN论坛上搜索了这个,但似乎每个人(我认为)建议恢复到RDP 7.x(卸载MS更新KB2592687).

我有一个用C#/ WPF编写的自定义远程桌面客户端,远程桌面ActiveX控件托管在WindowsFormsHost控件中.该应用程序更新RDP 8.0(MS更新KB2592687)之前运行良好.如果我卸载MS更新(恢复到RDP 7.1),该应用程序的工作原理.

我的RDP客户端用于连接Virtualbox VRDP(Virtualbox 4.2.x),无需身份验证(Null).安装了RDP 8.0后,Windows远程桌面客户端(mstsc.exe)连接得很好,响应性更好(RDP 8.0增强功能); 但我的自定义RD客户端无法连接.

经过进一步调查,我的自定义RDP客户端不会抛出任何异常或触发OnConnectingOnLogonError或大多数其他事件.奇怪的是,它只是解雇这两个事件(按顺序)

OnAuthenticationWarningDisplayed
OnAuthenticationWarningDismissed

我还使用RawCap(http://www.netresec.com/?page=RawCap)测试了我的自定义RDP客户端是否在这些事件之前向Virtualbox VRDP发送数据包.令人惊讶的是,它甚至没有发送数据包.(MS RD客户端 - mstsc.exe工作正常.)

所以它归结为我的自定义RDP客户端上的这些事件/方法调用,不幸的是我被卡住了.

(为简洁起见缩短了代码)

    AxMSTSCLib.AxMsRdpClient8 rdp = new AxMSTSCLib.AxMsRdpClient8();

    rdp.OnAuthenticationWarningDisplayed+=new EventHandler(rdp_OnAuthenticationWarningDisplayed);
    rdp.OnAuthenticationWarningDismissed+=new EventHandler(rdp_OnAuthenticationWarningDismissed);
    rdp.Server = server;
    rdp.AdvancedSettings8.RDPPort = 5050;

//No username/password since Virtualbox RDP authentication is set to *null*
//MS RD Client connects just fine to Virtualbox RDP without username/password

    try
    { 
       rdp.Connect();
    }
    catch (Exception ex)
    {
    }
Run Code Online (Sandbox Code Playgroud)

OnAuthenticationWarningDisplayed和 …

c# rdp remote-desktop

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

rdp ×1

remote-desktop ×1