在catch块中有一个return语句是错误的吗?有哪些替代方案?
即:
public bool SomeFunction()
{
try
{
//somecode
return true;
}
catch(Exception ex)
{
MessageBox.Show(ex.message);
return false;
}
}
Run Code Online (Sandbox Code Playgroud)