P
perspolis
Hi
I have a question about using exceptions or showing error messages .I say
this by an example
first way:
if(n<0 and w<0)
MessageBox.Show("please enter positive")
else if (n=0 or w>0)
MessageBox.show("n is 0");
or second way
try
{
if(n<0 and w<0)
throw new Exception("please enter positive")
else if (n=0 or w>0)
throw new Exception("n is 0");
}
catch(Exception err)
{
MessageBox.show(err.Message);
}
thanks in advance
I have a question about using exceptions or showing error messages .I say
this by an example
first way:
if(n<0 and w<0)
MessageBox.Show("please enter positive")
else if (n=0 or w>0)
MessageBox.show("n is 0");
or second way
try
{
if(n<0 and w<0)
throw new Exception("please enter positive")
else if (n=0 or w>0)
throw new Exception("n is 0");
}
catch(Exception err)
{
MessageBox.show(err.Message);
}
thanks in advance