NetBlog主题

C#添加线程
C#基础

C#添加线程

1075 0

namespace Test {class Program{static void Main(string[] args){Thread t1 = new Thread(new ThreadStart(TestMethod));Thread t2 = new Thread(new ParameterizedThreadStart(TestMethod));t1.IsBackground = true;t2.IsBackground = true;if(!t1.IsAlive)//线程状态,如果…