代码如下:
namespaceClient
{
publicpartialclassLogin:Form
{
privatestringip=null;
publicLogin()
{
InitializeComponent();
}
publicLogin(stringIP)
{
InitializeComponent();
ip=IP;
}
privatevoidLogin_Load(objectsender,EventArgse)
{
this.FormClosing+=Login_Closing;
this.Text=string.Format(“登录到:{0}”,ip);
//获取主机显示器屏幕分辨率
Rectanglerect=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.Exceptionex)
{
MessageBox.Show(ex.Message);
}
}
privatevoidLogin_Closing(objectsender,FormClosingEventArgse)
{
if(MessageBox.Show(“确认退出么?”,”提示”,MessageBoxButtons.YesNo,
MessageBoxIcon.Question,MessageBoxDefaultButton.Button2)==DialogResult.No)
e.Cancel=true;
}
}
}
您可能感兴趣的文章:无法进入远程桌面远程重启WIN2003服务器的方法正确开启Win2008远程桌面的方法windows服务器记录3389远程桌面IP策略用VBS修改远程桌面3389端口并添加到Windows防火墙的代码巧妙启用Windows2003的远程桌面巧妙启用Windows2003的远程桌面功能Win2003的“远程桌面”登录远程桌面时遇到“由于客户端检测到一个协议错误(代码0x1104)”
c#实现51单片机频率计的代码分享(数字频率计设计)
在Visual Studio中用C++语言创建DLL动态链接库图文教程
上述就是C#学习教程:利用微软com组件mstscax.dll实现window7远程桌面功能分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/905134.html