我在我的 WinForms 应用程序中托管 IMsRdpClient6 ActiveX 控件,以便与远程计算机建立连接。
我已经设置了一个终端服务网关机器,我可以成功使用它。
我想让我的 ActiveX 控件使用这个网关。我已经设置了网关选项,但连接失败,我看不到任何错误。这是我正在使用的代码:
MSTSCLib6.IMsRdpClient6 client6 = RdpClient.GetOcx() as MSTSCLib6.IMsRdpClient6;
if (client6 != null)
{
MSTSCLib6.IMsRdpClientTransportSettings2 transport = client6.TransportSettings2;
if (Convert.ToBoolean(transport.GatewayIsSupported) == true)
{
client6.TransportSettings.GatewayHostname = "mygateway";
client6.TransportSettings.GatewayUsageMethod = 2;
client6.TransportSettings.GatewayCredsSource = 0;
client6.TransportSettings.GatewayUserSelectedCredsSource = 0;
client6.TransportSettings2.GatewayDomain = "mydomain";
client6.TransportSettings2.GatewayPassword = "mypassword";
client6.TransportSettings2.GatewayUsername = "myusername";
}
}