using System;
using System.Threading;
using System.Threading.Tasks;
private Thread recvThread;
// 线程任务
private void recvThreadTask()
{
Thread.Sleep(100);
while (true)
{
}
}
recvThread = new Thread(recvThreadTask);
recvThread.Start();
//recvThread.Abort();
// 关闭线程
if (recvThread != null)
{
recvThread.Abort();
}