i created an RDP client in c# and when I try to connect to a GCP instance GCP Computer this its disconect me instant I using MSTSCLib.
I used this program with other servers and only with GCP instances I have this problem.
code:
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);
}
disconnect function
private void Rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
{
this.close();
}