서버가 살아 있나 죽어 있나를 확인해볼 수 있는 소스
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public void bool IsAddressRunning(string address) { try { WebClient webClient = new WebClient(); webClient.DownloadData(address); webClient.Dispose(); return true; } catch { return false; } } |
'C#' 카테고리의 다른 글
[Windows Service] 디버깅 (0) | 2016.08.05 |
---|---|
[Windows Service] 파일 읽기 (0) | 2016.07.14 |
[C#] 파일 경로 (0) | 2016.07.14 |
[C#] ini 파일 모든 섹션 & 키 값 읽기 (0) | 2016.07.08 |
[C#] DataGridView 크기 조절 (0) | 2016.07.08 |