利用微軟com組件mstscax.dll實(shí)現(xiàn)window7遠(yuǎn)程桌面功能
namespace Client
{
public partial class Login : Form
{
private string ip = null;
public Login()
{
InitializeComponent();
}
public Login(string IP)
{
InitializeComponent();
ip = IP;
}
private void Login_Load(object sender, EventArgs e)
{
this.FormClosing += Login_Closing;
this.Text = string.Format("登錄到:{0}", ip);
// 獲取主機(jī)顯示器屏幕分辨率
Rectangle rect = Screen.PrimaryScreen.Bounds;
try
{
rdp.Server = ip;
rdp.AdvancedSettings2.RDPPort = 3389;
rdp.Height = rect.Height;
rdp.Width = rect.Width;
//rdp.UserName = "client";
//rdp.AdvancedSettings2.ClearTextPassword = "client";
rdp.Connect();
rdp.FullScreen = true;
//this.FormBorderStyle = FormBorderStyle.None;
rdp.FullScreenTitle = this.Text;
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void Login_Closing(object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("確認(rèn)退出么?", "提示", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
e.Cancel = true;
}
}
}
相關(guān)文章
利用C#實(shí)現(xiàn)SSLSocket加密通訊的方法詳解
這篇文章主要給大家介紹了關(guān)于如何利用C#實(shí)現(xiàn)SSLSocket加密通訊的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2020-07-07
C#中用foreach語句遍歷數(shù)組及將數(shù)組作為參數(shù)的用法
這篇文章主要介紹了C#中用foreach語句遍歷數(shù)組及將數(shù)組作為參數(shù)的用法,C#的數(shù)組可作為實(shí)參傳遞給方法形參,需要的朋友可以參考下2016-01-01
C#連接到sql server2008數(shù)據(jù)庫的實(shí)例代碼
這篇文章主要介紹了C#連接到sql server2008數(shù)據(jù)庫的實(shí)例代碼,需要的朋友可以參考下2017-09-09
DevExpress實(shí)現(xiàn)GridControl顯示Gif動畫的方法
這篇文章主要介紹了DevExpress實(shí)現(xiàn)GridControl顯示Gif動畫的方法,這是比較實(shí)用的方法,需要的朋友可以參考下2014-08-08
淺析C# web訪問mysql數(shù)據(jù)庫-整理歸納總結(jié)
本篇文章是對C#中的web訪問mysql數(shù)據(jù)庫的一些知識點(diǎn)進(jìn)行了整理歸納總結(jié),需要的朋友可以參考下2013-07-07

