我怎么知道哪个Web应用程序正在调用我的方法 [英] How Can I Know Which Web Application Is Calling My Method

查看:59
本文介绍了我怎么知道哪个Web应用程序正在调用我的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友,



有一个类库,其中一个方法是WhoIsCallingMe(),这些方法由三个Web应用程序调用。



现在我的问题是,我怎么知道哪个Web应用程序在类库中调用我的方法?



你能建议怎么办吗?

解决方案

用它来获取网址



< pre lang =c#> string url = HttpContext.Current.Request.Url.AbsoluteUri;





然后拆分该字符串以获得所需的名称


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?

解决方案

use this to get url

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



and then split that string to get the required name


这篇关于我怎么知道哪个Web应用程序正在调用我的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆