Unfortunately that's not possible with current releases of the framework. "Fields" in a method aren't really fields at all, but rather just space
reserved on the stack for local variables. You need to access the IL of the method in question to find these.
-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "djp" <a@b.com>
Newsgroups: microsoft.public.dotnet.general
Subject: How to get fields in method using Reflection
Lines: 9
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <8k*******************@wagner.videotron.net>
Date: Wed, 4 Feb 2004 21:58:51 -0500
NNTP-Posting-Host: 24.202.62.229
X-Complaints-To: ab***@videotron.ca
X-Trace: wagner.videotron.net 1075949956 24.202.62.229 (Wed, 04 Feb 2004 21:59:16 EST)
NNTP-Posting-Date: Wed, 04 Feb 2004 21:59:16 EST
Path: cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.gamma.ru!
Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!news hosting.com!news-xfer1.atl.newshosting.com!diablo.voicenet.com!wesl ey.videotron.net!
wagner.videotron.net.POSTED!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:123724
X-Tomcat-NG: microsoft.public.dotnet.general
Hi,
I'm trying to access fields that are local to a method using reflection.
What BindingFlags value should I use and is this possible at all. So far I
was able to retreive class fields only.
Thanks