On Error Resume Next for C#?

C# 에서 VB와 같이 On Error Resume Next를 구현할 수 없을까?
VB의 경우는 에러가 발생하면 에라가 발생한 다음 라인으로 넘어가 서 자동 실행한다.

On Error Resume Next
        Dim strXML As String = File.ReadAllText("SomeNonExistentFileCausingAnErrorCondition.xml")
        If String.IsNullOrEmpty(strXML) Then
            strXML = strSomeOtherValidXmlThatIUseWhenTheFileIsEmpty
        End If
        Dim srXmL As StringReader = New StringReader(strXML)
        Dim dsXML As DataSet = New DataSet()
        dsXML.ReadXml(srXmL)
        If Err.Number <> 0 Then
            MsgBox(Err.Number & Space(1) & Err.Description)
            Exit Sub
        End If
        Dim str1 As String = dsXML.Tables("Table1").Rows(1)("Field1").ToString()
        Dim str2 As String = dsXML.Tables("Table2").Rows(2)("Field2").ToString()
        Dim str3 As String = dsXML.Tables("Table3").Rows(3)("Field3").ToString()
        Dim str4 As String = dsXML.Tables("Table4").Rows(4)("Field4").ToString()

마땅한 처리 방법은 없다 !!!
가장 간단한 방법은 정도가 아닐까? 마땅한 방법이 보이지 않는다
continue를 시행해서 For loop를 다시 실행하는 방법 말고 다른 방법은 없나

foreach()
{
     try
    {
       //Excute
    }
    catch (Exception e)
    {
       continue;
    }
}

“On Error Resume Next for C#?”의 8개의 댓글

  1. Hi there are using WordPress for your site platform?

    I’m new to the blog world but I’m trying to
    get started and set up my own. Do you require any html coding expertise
    to make your own blog? Any help would be greatly
    appreciated!

  2. Admiring the time and energy you put into your blog and in depth information you
    present. It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed
    material. Excellent read! I’ve saved your site and I’m including your RSS feeds to my Google account.

댓글 남기기