2020
10-08
10-08
实例代码讲解c# 线程(下)
前言实例代码讲解c#线程(上)使用Mutex类classProgram{staticvoidMain(string[]args){conststringMutexName="CSharpThreadingCookbook";using(varm=newMutex(false,MutexName)){if(!m.WaitOne(TimeSpan.FromSeconds(5),false)){Console.WriteLine("Secondinstanceisrunning!");}else{Console.WriteLine("Runing!");Console.ReadLine();m.Relea...
继续阅读 >