我尝试使用https://msdn.microsoft.com/en-us/library/jj553447(v=vs.85).aspx
中描述的RDP子会话我的代码:
private void button1_Click(object sender, EventArgs e)
{
axMsRdpClient9NotSafeForScripting1.Server = "localhost";
Object True = true;
MSTSCLib.IMsRdpExtendedSettings extSettings = (MSTSCLib.IMsRdpExtendedSettings)axMsRdpClient9NotSafeForScripting1.GetOcx();
extSettings.set_Property("ConnectToChildSession", True);
axMsRdpClient9NotSafeForScripting1.Connect();
}
但我在Connect()方法上遇到异常:
“价值不在扩展范围内”。
Сan有人帮助我吗?
答案 0 :(得分:1)
您需要启用凭据安全服务提供商支持才能连接到客户端会话。
在连接之前执行此操作...
IMsRdpClient7 msRdpClient = this.axMsRdpClient9NotSafeForScripting1.GetOcx() as IMsRdpClient7;
msRdpClient.AdvancedSettings7.EnableCredSspSupport = true;