I used the following construct in a logging application. It *might*
work for you :
---
private string GetCallerMethod()
{
StackFrame sf = new StackFrame(2, false);
StackTrace st = new StackTrace(sf);
MethodBase mb = sf.GetMethod();
string caller = string.Format("{0}.{1}", mb.DeclaringType.Name,
mb.Name);
return caller;
}
---
Here, mb.DeclaringType.Name might be the value you want.
On Oct 20, 8:45 pm, VillageIdiot <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I wrote a function in a VB.NET DLL. Is there a way for that function
> to determine which application is calling it?
>
> Thank you in advance for your assistance
>
> Village Idiot
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment
You may subscribe to group Feeds using a RSS Feed Reader to stay upto date
using following url
<a href="http://feeds.feedburner.com/DotNetDevelopment">
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---