在以下代码中,Inner_A(x) 中引发了异常。如何在堆栈跟踪中显示 x 的值,因为堆栈跟踪如下所示:
at Default2.Inner_A(String x) in C:\test1\Default2.aspx.vb:line 25
at Default2.Page_Load(Object sender, EventArgs e) in C:\test1\Default2.aspx.vb:line 12
Dim strErrorMesssage As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim x As String = "testvar"
Inner_A(x)
Catch ex As Exception
strErrorMesssage &= DirectCast(ex, System.ApplicationException).StackTrace.ToString()
End Try
End Sub
Private Function Inner_A(ByVal x As String) As String
Throw New ApplicationException("Exception Occured caused in INNER_A ")
Return " Function Inner_A"
End Function