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
LVL 4
adam_pedleyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Cheers!
armoghanCommented:
armoghanCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adam_pedleyAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.