C#中还有没有主线程与辅助线程
在WinForm程序中,现在还有没有主线程与非主线程的概念?这两种线程有什么区别么?
UI线程启动了另一个线程B,UI线程被杀掉了,另外一个线程会结束吗?
[解决办法]
public Form1()
{
InitializeComponent();
new System.Threading.Thread(delegate()
{
while (this.IsHandleCreated)
{
File.CreateText(string.Format("D:\\temp\\{0}.txt", DateTime.Now.ToString("HH_mm_ss_ff")));
System.Threading.Thread.Sleep(100);
}
}).Start();
}