获取应用程序的路径,而无需使用的HttpContext。 (asp.net) [英] Get application path without using httpcontext. (asp.net)
本文介绍了获取应用程序的路径,而无需使用的HttpContext。 (asp.net)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
怎么办呢?
我不想用这个:
HttpContext.Current.Server.MapPath
是否有类似的功能,我可以不需要调用的HttpContext?
Is there a similar function that I can call without requiring a httpcontext?
例如,如果一个启动一个线程做一些东西,我不能使用的HttpContext,但我仍然需要得到该应用程序的路径。而且没有我不能从一个共享变种传入上下文作为一个参数或读取。
For example if a start a thread doing some stuff i cant use the httpcontext, but i still need to get the path of the app. And no i can't pass the context as an argument or read it from a shared var.
推荐答案
使用的<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.httpruntime.appdomainapppath.aspx\"><$c$c>HttpRuntime.AppDomainAppPath$c$c>属性。
这篇关于获取应用程序的路径,而无需使用的HttpContext。 (asp.net)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文