简体   繁体   中英

remote desktop connection from windows to linux using c#.net

while develop in c# for rdp we use basically using MSTSCLib; but connecting linux this dll not supporting. So, what dll have to use for rdp from windows to linux in c# application.

namespace SampleRDC { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

    private void button1_Click(object sender, EventArgs e)
    {
        try
        {
            rdp.Server = txtServer.Text;
            rdp.UserName = txtUserName.Text;

            IMsTscNonScriptable secured = (IMsTscNonScriptable)rdp.GetOcx();
            secured.ClearTextPassword = txtPassword.Text;
            rdp.Connect();
        }
        catch (Exception Ex)
        {
            MessageBox.Show("Error Connecting", "Error connecting to remote desktop " + txtServer.Text + " Error:  " + Ex.Message,MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }

    private void button2_Click(object sender, EventArgs e)
    {
        try
        {
            // Check if connected before disconnecting
            if (rdp.Connected.ToString() == "1")
                rdp.Disconnect();
        }
        catch (Exception Ex)
        {
            MessageBox.Show("Error Disconnecting", "Error disconnecting from remote desktop " + txtServer.Text + " Error:  " + Ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}

}

based on this program how to write for windows to linux through remote desktop

看一下Putty ,您不能从Windows将RDP放入Linux机器,而可以使用称为SSH的协议,它没有GUI,并且所有内容都是基于文本的。

RDP is native to Windows. If you want Linux to act as RDP server, check out XRDP at http://sourceforge.net/projects/xrdp/

For Linux, you can SSH (which Putty supports). Another option is to enable VNC server, which most Linux distros support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM