我正在制作一个远程桌面应用程序。当我连接一个客户端时,我可以轻松进行远程处理,但我无法连接更多客户端。
我的代码:服务器
void start()
{
try
{
URI = "Tcp://"+textBox1.Text+":6600/MyCaptureScreenServer";
chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
obj = (ScreenCapture)Activator.GetObject(typeof(ScreenCapture), URI);
connected = true;
timer1.Enabled = true;
textBox1.ReadOnly = true;
this.FormBorderStyle = FormBorderStyle.None;// Full Size Mode
this.WindowState = FormWindowState.Maximized;
textBox1.Visible = false;
menuItem5.Enabled = true;
}
catch (Exception) {
stop();
}
}
客户:
TcpChannel chan = new TcpChannel(6600);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType("ScreenCapture, ScreenCapture"), "MyCaptureScreenServer",WellKnownObjectMode.Singleton);