0

I'm using the RDP ActiveX control in a web page to open remote desktop connections. Here is the code I using but it doesn't work, it gets stuck when calling the GetErrorDescription method:

<script language="vbscript">

    sub MsRdpClient_OnDisconnected(disconnectCode)

      dim error_message

      extendedDiscReason = MsRdpClient.ExtendedDisconnectReason

      MsRdpClient.GetErrorDescription disconnectCode, extendedDiscReason, error_message

      MsgBox error_message, 0, "Error"

    end sub

</script>

Thanks, Rafael

4

2 回答 2

0

我认为您正在达到此 [1] 限制。VBScript 仅适用于变体,因此它不能接受更具体类型的参数。

由于您无法更改 RDP ActiveX 控件,因此除了编写一个精简的 C++ 包装器之外,您几乎无能为力。但随之而来的还有其他令人头疼的问题……

[1] http://support.microsoft.com/kb/197957

于 2009-08-06T19:30:49.243 回答
0

我在 TechNet 论坛上找到了答案。

<script language="vbscript">

    sub MsRdpClient_OnDisconnected(disconnectCode)

      dim error_message

      extendedDiscReason = MsRdpClient.ExtendedDisconnectReason

      error_message = MsRdpClient.GetErrorDescription(disconnectCode, extendedDiscReason)

      MsgBox error_message, 0, "Error"

    end sub

</script>

现在我只需要知道如何用 javascript 而不是 vbscript 编写 MsRdpClient 事件处理程序。

于 2009-08-06T23:38:19.970 回答