sdbala Posted July 15, 2004 Posted July 15, 2004 i have a project in which i have many classes including forms. the problem that i have is when a error is caught, i should be able to find the class in which the error occured and method in which it occured. should i use the asembly if s how ?? Quote
Administrators PlausiblyDamp Posted July 15, 2004 Administrators Posted July 15, 2004 If you just need access to these details for display or logging purposes then you can use the excepetion's StackTrace property like : Try Dim i As Integer Dim s As String = "Fred" i = s Catch ex As Exception MessageBox.Show(ex.StackTrace) End Try If you require programatic access then if you could give a little more detail about how your code is organised / what you are trying to do then we can offer more help. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
sdbala Posted July 15, 2004 Author Posted July 15, 2004 I apreciate ur relpy but what i want is the exact class name and the method name. stackTrace is givin umnecssary details. for example u can use the application.name to find the application where the error occured Quote
Administrators PlausiblyDamp Posted July 15, 2004 Administrators Posted July 15, 2004 (edited) What do you need this information for? There may be a better way to achieve what you are trying to do. Edited July 15, 2004 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.