点击或拖拽改变大小

SoftBasicGetExceptionMessage 方法 (String, Exception)

获取一个异常的完整错误信息,和额外的字符串描述信息
Gets the complete error message for an exception, and additional string description information

命名空间:  HslCommunication.BasicFramework
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public static string GetExceptionMessage(
	string extraMsg,
	Exception ex
)

参数

extraMsg
类型:SystemString
额外的信息
ex
类型:SystemException
异常对象

返回值

类型:String
完整的字符串数据
异常
异常条件
NullReferenceException
示例
GetExceptionMessage示例
try
{
    int i = 0;
    int j = 10 / i;
}
catch (Exception ex)
{
    Console.WriteLine( "Msg", SoftBasic.GetExceptionMessage( ex ) );
}
参见