c# - 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();
}
解决方案
推荐阅读
- java - 如何应对这种无效的方法声明错误?
- javascript - 如何为 dataChannels 创建多方 webrtc 连接?
- python - Python:使用从同一函数中的函数生成的先前值
- windows - 如何使用 Flutter 2.0 WINdows Desktop 的共享首选项?或者是否有任何其他库与 Flutter Windows 桌面的共享首选项相同
- white-labelling - 如何为多个客户端添加白标脚本?
- javascript - javascript数字猜谜游戏正在输出随机信息
- django - 将模型导入同一目录中的不同文件时出现 ImportError
- javascript - Angular SetValue 在 NgOnInit 中不起作用
- react-native - React Native - sha256 code_challenge 在使用异步函数后没有返回正确的值
- visual-studio-code - 已安装 C# 扩展,但 Visual Studio 代码未检测到它