I'm using c# .net. My program contains a for loop and inside it I use try and catch, this way:
for(int i = 0; i< 5; i++)
{
try
{
// first command
}
catch
{
}
try
{
// second command
}
catch
{
}
}
The problem is that when the computer gets to the 1st catch, it does the 1st command but it doesn't continue to the 2nd :( I want it to continue normally even though it gets to the catch. Can I do it? How ?
Question
yyy
Hello,
I'm using c# .net. My program contains a for loop and inside it I use try and catch, this way:
for(int i = 0; i< 5; i++) { try { // first command } catch { } try { // second command } catch { } }The problem is that when the computer gets to the 1st catch, it does the 1st command but it doesn't continue to the 2nd :( I want it to continue normally even though it gets to the catch. Can I do it? How ?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts