在C#中连接rdp控件时。关联收益2

时间:2018-09-26 15:57:14

标签: remote-desktop rdp

在C#中连接rdp控件时。关联收益2。 2的意思是“控件正在建立连接”

rdp.Server = _server;
            rdp.UserName = _username;
            rdp.AdvancedSettings2.RDPPort = _port;

            Ping ping = new Ping();
            PingReply pingReply = ping.Send(rdp.Server);
            MessageBox.Show(pingReply?.Status.ToString());

            IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
            secured.ClearTextPassword = _password;


            rdp.Connect();
            //MessageBox.Show(rdp.);
            var txtMessage = "Connected";
            if (rdp.Connected == 0)
            {
                txtMessage = "Not Connected!";
            }
            if (rdp.Connected == 2)
            {
                txtMessage = "The control is establishing a connection";
            }
            MessageBox.Show(txtMessage);

0 个答案:

没有答案