首页 > 解决方案 > GCP计算机引擎断开我c#MSTSCLib

问题描述

我在 C# 中创建了一个 RDP 客户端,当我尝试连接到 GCP 实例 GCP 计算机时,这让我立即使用 MSTSCLib。

我将此程序与其他服务器一起使用,并且仅与 GCP 实例一起使用我有这个问题。

          try
             {
                 rdp.Server = "ip";
                 rdp.UserName = "user";
                 IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
                 secured.ClearTextPassword = "password";
                 rdp.Connect();
             }
             catch (Exception Ex)
             {
                 MessageBox.Show("Error Connecting", "Error connecting to remote desktop " + " Error:  " + Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }

断开功能

private void Rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            this.close();
        }

标签: c#google-compute-enginerdp

解决方案


推荐阅读