static void Main(string[] args) { //启动解析线程 MoveProcesser dataProcess = new MoveProcesser(); Thread m_thread = new Thread(new ThreadStart(dataProcess.Processing)); m_thread.Start(); Console.WriteLine("移动服务启动成功!"); string strLine; do { strLine = Console.ReadLine(); } while (strLine != null && strLine != "exit"); Console.WriteLine("移动服务结束..."); //kill thread if (m_thread.IsAlive) m_thread.Abort(); }
static void Main(string[] args) { //启动解析线程 MoveProcesser dataProcess = new MoveProcesser(); Thread m_thread = new Thread(new ThreadStart(dataProcess.Processing)); m_thread.Start(); Console.WriteLine("移动服务启动成功!"); string strLine; do { strLine = Console.ReadLine(); } while (strLine != null && strLine != "exit"); Console.WriteLine("移动服务结束..."); //kill thread if (m_thread.IsAlive) { m_thread.Abort(); } }