Link to home
Start Free TrialLog in
Avatar of adam_pedley
adam_pedley

asked on

Reflection to get Variable Names and Values

Hi

I have a function as such

Public Function Test as string
    Dim i as integer = 5
    Dim s as string = "testing"

End Function

In that function how could i use reflection to get all the variables and values that exist inside this function.

So using a command i could get a string that says
i - Integer - 5
s - String - "testing"

or something similar

Thanks
Adam
Avatar of armoghan
armoghan
Flag of Pakistan image

Hi adam_pedley,
This will help you
http://www.dotnet247.com/247reference/msgs/35/177502.aspx

Cheers!
ASKER CERTIFIED SOLUTION
Avatar of armoghan
armoghan
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of adam_pedley
adam_pedley

ASKER

Brilliant!

Thank you

Im not using 2005 yet but am in the middle of an upgrade to 2005.

I must say .NET 2.0 has really got its act together.