Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2006

Tip: Looking for answers? Try searching our database.

GetMethodName using Reflections Namespace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JerryWEC - 01 Aug 2006 20:47 GMT
I have a question regarding reflections or any other method of getting the
method name of the current method...

Does anyone have a method already built to capture the current method name?
I'm sure this can be coded using reflections but have never used this
namespace.  I need a little help in the right direction or the code for a
method to return this name.

I'd like to call this method in my error handling code just before handling
each error.  I know I can also parse the .stacktrace to get this name as
well.  However, it just seems to me that this requirement should be coded
from Reflections or a method call in the My namespace.

Any help is greatly appreciated!!!

JerryM
Greg Young - 01 Aug 2006 20:51 GMT
MethodBase.GetCurrentMethod
http://msdn2.microsoft.com/en-us/library/system.reflection.methodbase.getcurrent
method.aspx

the help includes an example.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

>I have a question regarding reflections or any other method of getting the
>method name of the current method...
[quoted text clipped - 12 lines]
>
> JerryM
JerryWEC - 01 Aug 2006 21:37 GMT
Thanks for the quick response!!  I'll write this down for use on my next
task.

I just realized that I can used it now because I'm in VB6.  I work in VB6,
VB.net (FW1.1 and 2.0) and some C#.

Thanks! JerryM

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.