Home All Groups Group Topic Archive Search About

Determine caller class name

Author
31 May 2006 3:17 AM
qingxun
Hi!

Is there a way in VB.NET to determine the caller's class name?

System.Reflection.MethodBase.GetCurrentMethod.GetType basically telling
me what is my current executing class, but I wanted to know, which
caller class invoke my existing class method.

Any help is much appreciated.


Bob

Author
31 May 2006 2:05 PM
Phill W.
qing***@gmail.com wrote:

> Is there a way in VB.NET to determine the caller's class name?

Why?  Code within any given method should not care how or from where it
was called.

If you need to do things differently within a method based on a given
value, pass that value as an argument to the method (you could, of
course, pass a reference to the calling object!).

Regards,
    Phill  W.