2
我是否可以檢查System.Threading.EventWaitHandle是否可以在不拋出異常的情況下打開?
try
{
using (var eventWaitHandle = EventWaitHandle.OpenExisting(name))
{
eventWaitHandle.Set();
}
Environment.Exit(0);
}
catch(WaitHandleCannotBeOpenedException)
{
// register new handle code goes here
}
有沒有辦法做到這一點不拋出/處理異常?
我沒有找到它 – 2012-03-30 13:10:26