标签:应用 pen ext use read nbsp ati stat ring
1 public static class Class1 2 { 3 static Queue<string> MsgQueue = new Queue<string>(); 4 5 static Class1() 6 { 7 ThreadPool.QueueUserWorkItem(q => 8 { 9 while (true) 10 { 11 lock (MsgQueue) 12 { 13 if (MsgQueue.Count > 0) 14 { 15 string msg = MsgQueue.Dequeue(); 16 //File.AppendAllText(path, msg); 17 } 18 else 19 { 20 Thread.Sleep(3000); 21 } 22 } 23 } 24 }); 25 } 26 27 public static void Insert(string msg) 28 { 29 lock (MsgQueue) 30 { 31 MsgQueue.Enqueue(msg); 32 } 33 } 34 }
标签:应用 pen ext use read nbsp ati stat ring
原文地址:http://www.cnblogs.com/shousiji/p/7602594.html