public material_in()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
Thread th=new Thread(new ThreadStart(this.InitComPort));//这个程序读串口数据
th.Start();
th.Join();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
Thread th=new Thread(new ThreadStart(this.InitComPort));//这个程序读串口数据
th.Start();
th.Join();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
th.Start();
th.Join();--> Thread th=new Thread(new ThreadStart(this.InitComPort));//这个程序读串口数据
th.Start();不要在Start之后就立即Join,在你需要关闭该线程的时候再去Join