Determine caller class name

Q

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
 
P

Phill W.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top