Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Reflection to get Variable Names and Values

Posted on 2006-03-22
4
Medium Priority
?
1,395 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:adam_pedley
  • 3
4 Comments
 
LVL 18

Expert Comment

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

Cheers!
0
 
LVL 18

Expert Comment

by:armoghan
ID: 16265982
0
 
LVL 18

Accepted Solution

by:
armoghan earned 2000 total points
ID: 16266085
0
 
LVL 4

Author Comment

by:adam_pedley
ID: 16266308
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.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question