如何在不使用Request对象的情况下获取当前应用程序URL(例如:HttpContext.Current.Request.Url.Authority)ASP.net

时间:2015-05-18 13:13:52

标签: asp.net url c#-4.0

我在执行自动作业调度时尝试获取当前URL。 执行自动作业调度时,请求对象为空。

我的代码:

string imgpath = HttpContext.Current.Request.Url.Authority + "/App_Themes/login_logo.png";

请求为null(HttpContext.Current.Request.Url.Authority =null)。所以我无法获得当前的网址。

另一种方法吗?

0 个答案:

没有答案
相关问题