SoftBasicGetExceptionMessage 方法 (String, Exception) |
获取一个异常的完整错误信息,和额外的字符串描述信息
Gets the complete error message for an exception, and additional string description information
命名空间:
HslCommunication.BasicFramework
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static string GetExceptionMessage(
string extraMsg,
Exception ex
)
Public Shared Function GetExceptionMessage (
extraMsg As String,
ex As Exception
) As String
public:
static String^ GetExceptionMessage(
String^ extraMsg,
Exception^ ex
)
static member GetExceptionMessage :
extraMsg : string *
ex : Exception -> string
参数
- extraMsg
- 类型:SystemString
额外的信息 - ex
- 类型:SystemException
异常对象
返回值
类型:
String完整的字符串数据
异常 异常 | 条件 |
---|
NullReferenceException | |
示例 try
{
int i = 0;
int j = 10 / i;
}
catch (Exception ex)
{
Console.WriteLine( "Msg", SoftBasic.GetExceptionMessage( ex ) );
}
参见