本文整理汇总了VB.NET中System.Diagnostics.DefaultTraceListener.Fail方法的典型用法代码示例。如果您正苦于以下问题:VB.NET DefaultTraceListener.Fail方法的具体用法?VB.NET DefaultTraceListener.Fail怎么用?VB.NET DefaultTraceListener.Fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.DefaultTraceListener
的用法示例。
在下文中一共展示了DefaultTraceListener.Fail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1:
' Report that the required argument is not present.
Const ENTER_PARAM As String = "Enter the number of " & _
"possibilities as a command line argument."
defaultListener.Fail(ENTER_PARAM)
If Not defaultListener.AssertUiEnabled Then
Console.WriteLine(ENTER_PARAM)
End If
示例2: CalcBinomial
' Compute the next binomial coefficient and handle all exceptions.
Try
result = CalcBinomial(possibilities, iter)
Catch ex As Exception
Dim failMessage As String = String.Format( _
"An exception was raised when " & _
"calculating Binomial( {0}, {1} ).", _
possibilities, iter)
defaultListener.Fail(failmessage, ex.Message)
If Not defaultListener.AssertUiEnabled Then
Console.WriteLine(failMessage & vbCrLf & ex.Message)
End If
Return
End Try