I have used the GetCurrentMethod and GetParameters via the
System.Reflection namespace. With this I am able to identify all of
the parameter names of the current method. What I would like to do is
get the current values of those parameters using those dynamically
determined parameter names.
The goal is this:
I want to write a logging function that captures all of the incoming
values for a method and writes them in name-value pairs.
e.g.
Public Sub MyReplace(str As String, oldVal As String, newVal As String)
' call my logging function here .. it dynamically processes the
params immediately above
End Sub
Log results:
str = 'The quick brown fox'
oldValue = 'quick'
newValue = 'speedy'
Thanks.
Mario T. Lanza
2007.01
Mattias Sjögren - 05 Jan 2007 19:58 GMT
>I have used the GetCurrentMethod and GetParameters via the
>System.Reflection namespace. With this I am able to identify all of
>the parameter names of the current method. What I would like to do is
>get the current values of those parameters using those dynamically
>determined parameter names.
Reflection doesn't let you do that.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Chuck C - 05 Jan 2007 21:39 GMT
You may want to do a bit more research on what Reflection actually is and
what "api hooking" or profiling is. Sounds like you have the two confused.
Reflection will only let you gather information about an assembly such as
function names and parameter names - not values.
API hooking or profiling allows you to see what values were passed into a
function when it was called.
"Mario" <mlanza@comcast.net> wrote in news:1168014446.867652.270090
@q40g2000cwq.googlegroups.com:
> I have used the GetCurrentMethod and GetParameters via the
> System.Reflection namespace. With this I am able to identify all of
[quoted text clipped - 22 lines]
> Mario T. Lanza
> 2007.01