다른 결과가있는 중첩 된 else if 문을 처리하는 더 좋은 방법이 있습니까? 여기 중첩 된 다른 방법 If 다른 결과가있는 If 문?
설명 내 중첩 된 문 중 하나의 예입니다 If My.Computer.Network.Ping(computerName) = True Then
Call InstallVS(computerName)
If My.Computer.Network.Ping(computerName) = True Then
Call PEC(computerName)
If My.Computer.Network.Ping(computerName) = True Then
Call RemoveSoftware(computerName)
Else
Call WriteLog(computerName & " lost connectivity while attemping to remove the temp software")
End If
Else
Call WriteLog(computerName & " lost connectivity while Forcing Communication")
End If
Else
Call WriteLog(computerName & " lost connectivity while attemping to Install")
End If
내가 문 이러한 유형의 많은에 대한 요구 사항이, 일부는 일부는 훨씬 더 크다, 작다.
참고. 그것은 당신이 보여주고 자하는 행동을 보여줍니다. 아래의 대답은 올바른 결과를 제공합니다. 왜냐하면 예외를 throw하는 경우에는 AFTERWARDS – Martin