第1个回答 2007-06-01
public void Listen() //监听端口
{
try
{
objTcpListener=new TcpListener(7788);
objTcpListener.Start();
while(true)
{
objSocket=objTcpListener.AcceptSocket();
if(objSocket.Connected)
{
th=new Thread(new ThreadStart(this.ReceiveCl));
th.Start();
conn="ok";
}
}
}
catch(Exception ex)
{
// MessageBox.Show("服务器监听错误:"+ex.Message);
}
}