111,092
社区成员




string errorMsg = ex.Message;
if (ex.InnerException != null)
{
if (ex.InnerException.InnerException != null)
{
//.....
}
else
{
errorMsg = ex.InnerException.Message;
}
}
var str = ex.Message;
while (ex.InnerException != null)
{
ex = ex.InnerException;
str += ex.ToString(); // ex.Message;
}
string GetInnerException(Exception ex)
{
if (ex.InnerException != null)
{
return GetInnerException(ex.InnerException);
}
return ex.Message;
}