2016. 4. 8. 19:16
--------------------------------------------------------------------------------------------------------------
static ManualResetEvent _quitEvent = new ManualResetEvent(false);
static void Main() {
Console.CancelKeyPress += (sender, eArgs) => {
_quitEvent.Set();
eArgs.Cancel = true;
};
// kick off asynchronous stuff
_quitEvent.WaitOne();
// cleanup/shutdown and quit
}
--------------------------------------------------------------------------------------------------------------
'.NET > C#' 카테고리의 다른 글
C# Linq IEnumerable to XML (840) | 2017.05.17 |
---|---|
[Visual Studio] 검색 정규식 (0) | 2014.12.12 |
Add radio button list items programmatically in asp.net (287) | 2014.12.09 |
Static Constructor in C (0) | 2014.09.06 |
실버라이트 개요 (0) | 2014.05.13 |