繁体   English   中英

使用c#.net从Windows到Linux的远程桌面连接

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

在rdp的c#开发中,我们基本上使用MSTSCLib; 但是连接Linux这个DLL不支持。 因此,从Windows到C#应用程序中的linux,哪些dll必须用于rdp。

命名空间SampleRDC {公共局部类Form1:Form {公共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);
        }
    }
}

}

基于此程序,如何通过远程桌面将Windows写入linux

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

RDP是Windows固有的。 如果您希望Linux充当RDP服务器,请访问http://sourceforge.net/projects/xrdp/查看XRDP。

对于Linux,您可以使用SSH(Putty支持)。 另一个选择是启用大多数Linux发行版支持的VNC服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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