728x90
반응형
class Program { static void Main(string[] args) { int iNum; while (true) { try { Console.WriteLine("정수를 입력하세요."); iNum = int.Parse(Console.ReadLine()); Console.WriteLine("정수를 입력했습니다."); break; } catch (Exception) { Console.WriteLine("정수를 입력하지 않았습니다."); } } } }

728x90
'기술자료 > C#' 카테고리의 다른 글
C# 소켓 억셉트 Socket Asynchronous Accept 초간단 소스 (0) | 2021.09.15 |
---|---|
C# Console 비동기 입력 ReadLine ReadKey Asynchronous input 초간단 소스 (0) | 2021.09.15 |
C# Packet Capture Programming #4 - 패킷 출력 HexaView (0) | 2021.09.07 |
C# Packet Capture Programming #3 - 패킷 캡쳐 GetNextPacket (0) | 2021.09.07 |
static HexaViewer Class 구현 - ArraySegment 응용 (0) | 2021.09.07 |
C# Packet Capture Programming #2 - 캡쳐 장치 선정 ICaptureDevice (0) | 2021.09.01 |
C# Packet Capture Programming #1 (0) | 2021.09.01 |
포인터 사용 C# Pointer unsafe (0) | 2021.04.29 |