1
.NET에서 예외 처리를 보여주는이 간단한 프로그램이 있습니다.이 경우 ArgumentOutOfRangeException
을 잡았지만 콘솔에 전달하는 사용자 지정 메시지가 표시되지 않습니다. 여기 콘솔에 사용자 지정 예외 메시지가 표시되지 않습니다.
using System;
class program
{
static void Main()
{
int[] source = { 1, 2, 3, 4, 5 };
int[] destination = { 6, 7, 8, 9 };
try
{
Array.Copy(source, destination, 7);
}
catch (ArgumentOutOfRangeException e)
{
Console.WriteLine("Sorry, there is something wrong in the program ! : {0}", e.Message);
}
}
}
및
당신은ArgumentOutOfRangeException
을 잡기하고 출력 화면
제목을 편집했습니다. "[제목에"태그 "가 포함되어 있어야합니까?] (http://meta.stackexchange.com/questions/19190/)"합의가 "아니오, 그렇지 않아야합니다"로 표시되어야합니다. –