23 lines
556 B
C#
23 lines
556 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WindowsFormsApp1.server
|
|
{
|
|
public class ThreadHelp :IDisposable
|
|
{
|
|
public Thread Thread { get; set; }
|
|
public bool isrunning1 {get;set;}= false;
|
|
public CancellationTokenSource cancellationTokenSource1{get;set;}
|
|
public void Dispose()
|
|
{
|
|
cancellationTokenSource1?.Cancel();
|
|
cancellationTokenSource1?.Dispose();
|
|
Thread = null;
|
|
}
|
|
}
|
|
}
|