Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

There is is one Class Library with one method "WhoIsCallingMe()" and these method calling by three web applications.

Now my Question is, How can i know which Web Application is calling my method in Class Library?

Can you please suggest how to proceed it?
Posted
Comments
BillWoodruff 23-Jan-14 4:46am    
Can't you have each application pass a parameter to the method:

WhoIsCallingMe("web app 1");

WhoIsCallingMe("console app 1");
Naga Sindhura 23-Jan-14 9:51am    
Hi BillWoodruff,
No Parameters passing from or to WhoIsCallingMe() method.

1 solution

use this to get url

C#
string url = HttpContext.Current.Request.Url.AbsoluteUri;


and then split that string to get the required name
 
Share this answer
 
Comments
Naga Sindhura 23-Jan-14 0:20am    
Hi navin,
Your Query is working fine in webapplication, i want to same result from my Console Application. Is there any way to proceed?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900