C#线程的问题
if (this.listenthread.ThreadState == ThreadState.Running)
{
this.listenthread.Abort();
try
{
listBox1.Enabled = true;
int hostport=3536;
//IPAddress ipAddress = Dns.Resolve("localhost").AddressList[0];
IPAddress ipAddress = IPAddress.Parse("0.0.0.0");
lep = new IPEndPoint(ipAddress, hostport);
socket1 = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket1.Bind(lep);
socket1.Listen(10000);
this.statusBar1.Text = "请求对方连接中...";
//button3.Enabled = false;
Thread watt = new Thread(new ThreadStart(waits));
watt.Start();
}
catch
{
this.statusBar1.Text = "";
}
为什么不能建立新的线程呢???高手指点