Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用MSTSCLib登录到远程桌面_C#_Remote Desktop_Rdp - Fatal编程技术网

C# 使用MSTSCLib登录到远程桌面

C# 使用MSTSCLib登录到远程桌面,c#,remote-desktop,rdp,C#,Remote Desktop,Rdp,我正在尝试登录远程桌面。我可以用以下代码打开登录屏幕。(rdpSP是Microsoft终端服务器客户端控件-版本1) 现在我可以看到登录屏幕和用户域/用户名。但是密码没有被使用。 是否可以自动登录或至少填写密码?密码应以rdpSP.AdvancedSettings9.ClearTextPassword的形式保存。它有很多事件,它们会告诉您出了什么问题。如果您不订阅,则无法判断问题所在。我应该尝试什么活动?我使用了onconnecting和onconnected,但似乎没有什么不对劲。报告错误的应

我正在尝试登录远程桌面。我可以用以下代码打开登录屏幕。(rdpSP是Microsoft终端服务器客户端控件-版本1)

现在我可以看到登录屏幕和用户域/用户名。但是密码没有被使用。
是否可以自动登录或至少填写密码?

密码应以
rdpSP.AdvancedSettings9.ClearTextPassword的形式保存。它有很多事件,它们会告诉您出了什么问题。如果您不订阅,则无法判断问题所在。我应该尝试什么活动?我使用了onconnecting和onconnected,但似乎没有什么不对劲。报告错误的应该在列表的顶部。OnLogonError、OnFatalError、OnWarning。这些事件都不会被调用,因此我认为它没有错误。我认为不接受提供的密码并强制用户手动输入密码是一种服务器设置。
  rdpSP.Server = "the IP";
  rdpSP.Domain = "the domain";
  rdpSP.UserName = "the username";
  MSTSCLib.IMsTscNonScriptable secured = (MSTSCLib.IMsTscNonScriptable)rdpSP.GetOcx();
  secured.ClearTextPassword = "the password";
  rdpSP.Width = this.Width;
  rdpSP.Height = this.Height;
  rdpSP.Connect();