asp.net获取应用程序路径
Code Snippet
- public static string ApplicationPath()
- {
- string m_Application;
- if (HttpContext.Current.Request.ApplicationPath.Equals("/"))
- {
- m_Application = "http://" + HttpContext.Current.Request.Url.Authority;
- }
- else
- m_Application = HttpContext.Current.Request.ApplicationPath;
- return m_Application;
- }
可以获取网站路径和虚拟目录路径