|
|
|
Click here to copy the following block |
Sub DisplayExceptionInfo(ByVal e As Exception) Console.WriteLine(e.Message)
Dim st As New StackTrace(e, True) Dim i As Integer
For i = 0 To st.FrameCount - 1 Dim sf As StackFrame = st.GetFrame(i) Dim mi As MemberInfo = sf.GetMethod Dim res As String = mi.DeclaringType.Namespace & "." res &= mi.DeclaringType.Name & "." res &= mi.Name Dim objParameters() As ParameterInfo = sf.GetMethod.GetParameters() Dim objParameter As ParameterInfo Dim strParameterString As String = "" strParameterString &= "(" For Each objParameter In objParameters If strParameterString.Length <> 1 Then strParameterString &= ", " End If strParameterString &= objParameter.Name & " As " & _ objParameter.ParameterType.Name Next strParameterString &= ")" res &= strParameterString
If sf.GetFileName <> "" Then res &= " (" & sf.GetFileName & ", Line " & sf.GetFileLineNumber & _ ", Col " & sf.GetFileColumnNumber End If If sf.GetILOffset <> StackFrame.OFFSET_UNKNOWN Then res &= ", IL offset " & sf.GetILOffset.ToString End If res &= ", native offset " & sf.GetNativeOffset & ")"
Console.WriteLine(res) Next End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
 |

|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|