Rectangle rect = new Rectangle();//通过一个函数对这个矩形对象赋值,这些值就是屏幕的工作区域
rect = Screen.GetWorkingArea(this);
int width = rect.Width;
int height = rect.Height;
try
{
bool IsIp = IsIP(textBox1.Text.Trim());
if (IsIp)
{
rdpClient = new AxMSTSCLib.AxMsRdpClient();
rdpClient.Width = width;//控件宽度
rdpClient.Height = height;//控件宽度
this.Controls.Add(rdpClient);
rdpClient.Server = textBox1.Text;//服务器地址
rdpClient.UserName = textBox2.Text;//用户名;
rdpClient.AdvancedSettings2.RDPPort = 3389;
rdpClient.AdvancedSettings2.ClearTextPassword = textBox3.Text;//密码
rdpClient.ColorDepth = 16;//颜色位数
rdpClient.FullScreen = false;//是否全屏
rdpClient.Connect();
//Process.Start(@"E:\zserp\tcerp\xs\hstc.exe");
groupBox1.Visible = false;
WindowState = FormWindowState.Maximized;
}
else
MessageBox.Show("IP格式不正确!");
}
catch (Exception)
{
MessageBox.Show("出错了!");
//Application.Exit();
//throw;
}以上是我编写的连接远程桌面的代码,连接没问题了,可以怎么指定打开客户机的哪个程序呢,我想一连接过去的时候就打开这个程序E:programfile\htcs.exe
请给出详细代码,谢谢
rect = Screen.GetWorkingArea(this);
int width = rect.Width;
int height = rect.Height;
try
{
bool IsIp = IsIP(textBox1.Text.Trim());
if (IsIp)
{
rdpClient = new AxMSTSCLib.AxMsRdpClient();
rdpClient.Width = width;//控件宽度
rdpClient.Height = height;//控件宽度
this.Controls.Add(rdpClient);
rdpClient.Server = textBox1.Text;//服务器地址
rdpClient.UserName = textBox2.Text;//用户名;
rdpClient.AdvancedSettings2.RDPPort = 3389;
rdpClient.AdvancedSettings2.ClearTextPassword = textBox3.Text;//密码
rdpClient.ColorDepth = 16;//颜色位数
rdpClient.FullScreen = false;//是否全屏
rdpClient.Connect();
//Process.Start(@"E:\zserp\tcerp\xs\hstc.exe");
groupBox1.Visible = false;
WindowState = FormWindowState.Maximized;
}
else
MessageBox.Show("IP格式不正确!");
}
catch (Exception)
{
MessageBox.Show("出错了!");
//Application.Exit();
//throw;
}以上是我编写的连接远程桌面的代码,连接没问题了,可以怎么指定打开客户机的哪个程序呢,我想一连接过去的时候就打开这个程序E:programfile\htcs.exe
请给出详细代码,谢谢
rdp协议...刚开始,我还以为是参数...后来发现参数只能调整屏幕高度,宽度等一些信息...
打开指定的程序应该是发送一个命令给客户端...楼主试试...
群号:29037453