Advertisement

09.03.2007 at 06:29AM PDT, ID: 22803630
[x]
Attachment Details

Getting function/procedure paramters ..

Asked by Kinger247 in Microsoft Visual Basic.Net

Tags: function, procedure

I've written a procedure to log each function/procedure name (for debug purposes). This is run at the start of every function/procedure for debug purposes. But I want to also get the parameters passed (if any) of the calling function/procedure and be able to display them in a text file without having to hard code them. Is there a way using reflection to do this ?

Here is a snippet of my code so far:

Dim currentMethod As System.Reflection.MethodBase
currentMethod = New System.Diagnostics.StackTrace().GetFrame(1).GetMethod()

MessageBox.Show("Current Method is " + currentMethod.ReflectedType.FullName + "." + currentMethod.Name)Start Free Trial
[+][-]09.03.2007 at 10:28AM PDT, ID: 19821501

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2007 at 10:35AM PDT, ID: 19842123

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: function, procedure
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.07.2007 at 02:23AM PDT, ID: 19846293

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628