PC Review


Reply
Thread Tools Rate Thread

Determining the current procedure name and the namespace for the class it is in

 
 
roddles
Guest
Posts: n/a
 
      27th Feb 2004
Hi

I need to at runtime determine the name of the function I am currently in, and the namespace of the class the function is executing from. I need this information for some logging routines i am writing and I do not want to have to hard code everything

Can someone tell me which classes i need to use in order to get this information. Some sample code snippets would be very helpful if available

Cheer

Rod.

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      27th Feb 2004
* roddles <rodney.lane@-NOSPAM-rivendelltechnologies.com> scripsit:
> I need to at runtime determine the name of the function I am currently
> in, and the namespace of the class the function is executing from. I
> need this information for some logging routines i am writing and I do
> not want to have to hard code everything.


For the method:

\\\
MsgBox(System.Reflection.MethodBase.GetCurrentMethod().Name)
///

--
Herfried K. Wagner [MVP]
<http://dotnet.mvps.org/>
Website Address Changed!
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The type or namespace name 'Generic' does not exist in the class or namespace 'System.Collections' pantagruel Microsoft C# .NET 1 23rd Oct 2007 12:07 AM
Automatically generate a string of the namespace, class, function/procedure. Mufasa Microsoft C# .NET 3 12th Sep 2007 02:48 PM
Current namespace /class Islam Elkhayat Microsoft ASP .NET 1 12th Feb 2005 02:22 AM
Current namespace /class Islam Elkhayat Microsoft C# .NET 1 12th Feb 2005 02:22 AM
Reading the current Namespace.Class, Assemble at runtime Mike Walters Microsoft VB .NET 1 3rd Aug 2004 02:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 AM.