利用微軟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#使用游標(biāo)實(shí)現(xiàn)補(bǔ)間函數(shù)
這篇文章主要為大家詳細(xì)介紹了C#使用游標(biāo)實(shí)現(xiàn)補(bǔ)間函數(shù),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-02-02C# 定時(shí)器定時(shí)更新的簡單實(shí)例
這篇文章主要介紹了C#中定時(shí)器定時(shí)更新的簡單實(shí)例。需要的朋友可以過來參考下,希望對(duì)大家有所幫助2013-12-12C# [ImportDll()] 知識(shí)小結(jié)
今天小編就為大家分享一篇關(guān)于C# [ImportDll()] 知識(shí)小結(jié),小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧2019-01-01